From 8de7933480c1e21cefbcaa81251d90977c0e9f53 Mon Sep 17 00:00:00 2001 From: Wiktor Sierocinski Date: Mon, 6 Nov 2023 16:54:46 +0100 Subject: [PATCH] Improving OptionsBlock --- src/components/Block.vue | 4 +++- src/components/blocks/OptionsBlock.vue | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/Block.vue b/src/components/Block.vue index 4a35372..a42afe0 100644 --- a/src/components/Block.vue +++ b/src/components/Block.vue @@ -157,7 +157,9 @@ function keyDownHandler(event: KeyboardEvent) { const selection = window.getSelection() if (!(menu.value && menu.value.open) && atFirstChar() && selection && selection.anchorOffset === 0) { event.preventDefault() - emit('merge') + if (isTextBlock(props.block.type)) { + emit('merge') + } } } else if (event.key === 'Enter') { entersPressed.value += 1 diff --git a/src/components/blocks/OptionsBlock.vue b/src/components/blocks/OptionsBlock.vue index cc617c1..e177deb 100644 --- a/src/components/blocks/OptionsBlock.vue +++ b/src/components/blocks/OptionsBlock.vue @@ -1,5 +1,5 @@