Fix arrow keys in text inputs (#10244)

Fixes #10239

# Important Notes
This is a quick fix, but we may consider better focus handling - perhaps the graph editor should be focusable?
This commit is contained in:
Adam Obuchowicz 2024-06-11 18:12:35 +02:00 committed by GitHub
parent 4da5e611c9
commit a2c4d94735
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 3 deletions

View File

@ -331,6 +331,10 @@ const editorStyle = computed(() => {
ref="rootElement"
class="CodeEditor"
:style="editorStyle"
@keydown.arrow-left.stop
@keydown.arrow-right.stop
@keydown.arrow-up.stop
@keydown.arrow-down.stop
@keydown.enter.stop
@keydown.backspace.stop
@keydown.delete.stop

View File

@ -481,6 +481,8 @@ const handler = componentBrowserBindings.handler({
@keydown.enter.stop
@keydown.backspace.stop
@keydown.delete.stop
@keydown.arrow-left.stop
@keydown.arrow-right.stop
>
<div class="panels">
<div class="panel components">

View File

@ -87,6 +87,8 @@ export const widgetDefinition = defineWidget(
@pointerdown.stop
@click.stop
@keydown.enter.stop
@keydown.arrow-left.stop
@keydown.arrow-right.stop
/>
</div>
</template>

View File

@ -99,8 +99,6 @@ export const widgetDefinition = defineWidget(
ref="input"
v-model="editedContents"
autoSelect
@pointerdown.stop
@click.stop
@keydown.enter.stop="accepted"
@focusin="editing.start()"
@input="editing.edit(makeLiteralFromUserInput($event ?? ''))"

View File

@ -1,5 +1,14 @@
<template>
<div ref="lexicalElement" class="LexicalContent" spellcheck="false" contenteditable="true" />
<div
ref="lexicalElement"
class="LexicalContent"
spellcheck="false"
contenteditable="true"
@keydown.arrow-left.stop
@keydown.arrow-right.stop
@keydown.arrow-up.stop
@keydown.arrow-down.stop
/>
</template>
<style scoped>

View File

@ -61,8 +61,12 @@ defineExpose({
v-model="innerModel"
class="AutoSizedInput"
:style="inputStyle"
@pointerdown.stop
@click.stop
@keydown.backspace.stop
@keydown.delete.stop
@keydown.arrow-left.stop
@keydown.arrow-right.stop
@keydown.enter.stop="onEnterDown"
@input="emit('input', innerModel)"
@change="onChange"