Skip to content

Commit 1aa9746

Browse files
committed
fix(HexViewer): address offset & scrollY
1 parent c872a13 commit 1aa9746

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/modules/blob/HexViewer.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ const onScroll = (e) => {
4949
5050
if (scrollOffset.value + 40 + 1 > props.hex.length && e.deltaY > 0) return
5151
if (props.bytes.length < 40) return
52-
if (e.deltaY < 0 && scrollOffset.value === 0) return
52+
if (e.deltaY < 0 && scrollOffset.value <= 0) {
53+
if (scrollOffset.value < 0) scrollOffset.value = 0
54+
return
55+
}
5356
scrollOffset.value += e.deltaY > 0 ? 1 : -1
5457
}
5558
@@ -119,7 +122,7 @@ const isSelected = (idx) => {
119122
<Flex gap="6">
120123
<Flex direction="column" :class="$style.row_labels">
121124
<Text v-for="i in 40" size="12" weight="600" color="support" mono :class="$style.row_label">
122-
{{ (i * (scrollOffset + 1)).toString(16).padStart(6, "0") }}
125+
{{ (i + scrollOffset).toString(16).padStart(6, "0") }}
123126
</Text>
124127
</Flex>
125128

0 commit comments

Comments
 (0)