chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-25 17:38:56 +01:00
committed by Braks
parent fd79ab141d
commit 0d2959701c
2 changed files with 9 additions and 6 deletions
@@ -18,8 +18,8 @@ const dragging = useDrag({
},
})
watch($$(disableKeyboardA11y), (a11yDisabled) => {
if (!a11yDisabled) {
onMounted(() => {
if (!disableKeyboardA11y) {
el.value?.focus({ preventScroll: true })
}
})
@@ -33,9 +33,13 @@ const innerStyle = computed(() => ({
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]) {
updatePositions(
{
@@ -68,7 +72,7 @@ export default {
:style="innerStyle"
:tabIndex="disableKeyboardA11y ? undefined : -1"
@contextmenu="onContextMenu"
@keydown="disableKeyboardA11y ? undefined : onKeyDown"
@keydown="onKeyDown"
/>
</div>
</template>
@@ -155,7 +155,6 @@ function onMouseUp(event: MouseEvent) {
}
function onMouseLeave(event: MouseEvent) {
console.log('mouseleave')
if (!hasActiveSelection.value) return emits.paneMouseLeave(event)
if (userSelectionActive.value) {