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" ref="rootElement"
class="CodeEditor" class="CodeEditor"
:style="editorStyle" :style="editorStyle"
@keydown.arrow-left.stop
@keydown.arrow-right.stop
@keydown.arrow-up.stop
@keydown.arrow-down.stop
@keydown.enter.stop @keydown.enter.stop
@keydown.backspace.stop @keydown.backspace.stop
@keydown.delete.stop @keydown.delete.stop

View File

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

View File

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

View File

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

View File

@ -1,5 +1,14 @@
<template> <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> </template>
<style scoped> <style scoped>

View File

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