This is an automated email from the ASF dual-hosted git repository.
rstrickland pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git
The following commit(s) were added to refs/heads/main by this push:
new ca93690 Data Editor File Traversal onclick Hotfix
ca93690 is described below
commit ca936909602160508bfe5f5757fd0268cd5e2a6c
Author: Robert Strickland <[email protected]>
AuthorDate: Fri Aug 4 09:25:46 2023 -0500
Data Editor File Traversal onclick Hotfix
- Fixes an issue where the user could traverse the file via the file
traversal pseudo scrollbar, if a selection was active.
Closes #731
---
.../src/components/DataDisplays/CustomByteDisplay/DataLineFeed.svelte | 1 +
.../DataDisplays/CustomByteDisplay/FileTraversalIndicator.svelte | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git
a/src/svelte/src/components/DataDisplays/CustomByteDisplay/DataLineFeed.svelte
b/src/svelte/src/components/DataDisplays/CustomByteDisplay/DataLineFeed.svelte
index 84826cf..93188c3 100644
---
a/src/svelte/src/components/DataDisplays/CustomByteDisplay/DataLineFeed.svelte
+++
b/src/svelte/src/components/DataDisplays/CustomByteDisplay/DataLineFeed.svelte
@@ -523,6 +523,7 @@ limitations under the License.
<FlexContainer --dir="column">
<FileTraversalIndicator
totalLines={totalLinesPerFilesize}
+ selectionActive={$selectionDataStore.active}
currentLine={lineTop}
fileOffset={viewportData.fileOffset}
maxDisplayLines={NUM_LINES_DISPLAYED}
diff --git
a/src/svelte/src/components/DataDisplays/CustomByteDisplay/FileTraversalIndicator.svelte
b/src/svelte/src/components/DataDisplays/CustomByteDisplay/FileTraversalIndicator.svelte
index a94a1c6..7c91a77 100644
---
a/src/svelte/src/components/DataDisplays/CustomByteDisplay/FileTraversalIndicator.svelte
+++
b/src/svelte/src/components/DataDisplays/CustomByteDisplay/FileTraversalIndicator.svelte
@@ -25,6 +25,7 @@ limitations under the License.
export let bytesPerRow = 16
export let percentageTraversed
export let maxDisplayLines = 20
+ export let selectionActive
let indicatorContainer: HTMLElement
let indicatorClickDisabled: boolean = false
@@ -46,8 +47,8 @@ limitations under the License.
indicatorContainer.addEventListener('click', updatePercentageTraversed)
}
}
-
function updatePercentageTraversed(e: MouseEvent) {
+ if (selectionActive) return
// Calculate the position of the click relative to the indicator container
const relativeClickPosition =
e.clientX - indicatorContainer.getBoundingClientRect().left