chore(core): cleanup
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -18,8 +18,8 @@ const dragging = useDrag({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
watch($$(disableKeyboardA11y), (a11yDisabled) => {
|
onMounted(() => {
|
||||||
if (!a11yDisabled) {
|
if (!disableKeyboardA11y) {
|
||||||
el.value?.focus({ preventScroll: true })
|
el.value?.focus({ preventScroll: true })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -33,9 +33,13 @@ const innerStyle = computed(() => ({
|
|||||||
left: `${selectedNodesBBox.x}px`,
|
left: `${selectedNodesBBox.x}px`,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const onContextMenu = (event: MouseEvent) => emits.selectionContextMenu({ event, nodes: getSelectedNodes })
|
function onContextMenu(event: MouseEvent) {
|
||||||
|
emits.selectionContextMenu({ event, nodes: getSelectedNodes })
|
||||||
|
}
|
||||||
|
|
||||||
|
function onKeyDown(event: KeyboardEvent) {
|
||||||
|
if (disableKeyboardA11y) return
|
||||||
|
|
||||||
const onKeyDown = (event: KeyboardEvent) => {
|
|
||||||
if (arrowKeyDiffs[event.key]) {
|
if (arrowKeyDiffs[event.key]) {
|
||||||
updatePositions(
|
updatePositions(
|
||||||
{
|
{
|
||||||
@@ -68,7 +72,7 @@ export default {
|
|||||||
:style="innerStyle"
|
:style="innerStyle"
|
||||||
:tabIndex="disableKeyboardA11y ? undefined : -1"
|
:tabIndex="disableKeyboardA11y ? undefined : -1"
|
||||||
@contextmenu="onContextMenu"
|
@contextmenu="onContextMenu"
|
||||||
@keydown="disableKeyboardA11y ? undefined : onKeyDown"
|
@keydown="onKeyDown"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ function onMouseUp(event: MouseEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onMouseLeave(event: MouseEvent) {
|
function onMouseLeave(event: MouseEvent) {
|
||||||
console.log('mouseleave')
|
|
||||||
if (!hasActiveSelection.value) return emits.paneMouseLeave(event)
|
if (!hasActiveSelection.value) return emits.paneMouseLeave(event)
|
||||||
|
|
||||||
if (userSelectionActive.value) {
|
if (userSelectionActive.value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user