diff --git a/src/lib/components/controls/EditableDiv.svelte b/src/lib/components/controls/EditableDiv.svelte index c8e7a84a..cb9da99c 100644 --- a/src/lib/components/controls/EditableDiv.svelte +++ b/src/lib/components/controls/EditableDiv.svelte @@ -86,11 +86,15 @@ const combo = keyComboFromEvent(event) if (combo === 'Escape') { + event.preventDefault() + handleCancel() } if (combo === 'Enter' || combo === 'Tab') { // apply changes + event.preventDefault() + closed = true const newValue = getDomValue() diff --git a/src/lib/components/controls/navigationBar/NavigationBarPathEditor.svelte b/src/lib/components/controls/navigationBar/NavigationBarPathEditor.svelte index 7d0fd589..c1568383 100644 --- a/src/lib/components/controls/navigationBar/NavigationBarPathEditor.svelte +++ b/src/lib/components/controls/navigationBar/NavigationBarPathEditor.svelte @@ -72,10 +72,13 @@ const combo = keyComboFromEvent(event) if (combo === 'Escape') { + event.preventDefault() onClose() } if (combo === 'Enter') { + event.preventDefault() + validationActive = true const result = parseAndValidate(inputPath) if (result.path !== undefined) { diff --git a/src/lib/components/modes/tablemode/TableMode.svelte b/src/lib/components/modes/tablemode/TableMode.svelte index 7e388c3c..d1e14ebf 100644 --- a/src/lib/components/modes/tablemode/TableMode.svelte +++ b/src/lib/components/modes/tablemode/TableMode.svelte @@ -1307,6 +1307,8 @@ } if (combo === 'Ctrl+Enter' && isValueSelection(selection)) { + event.preventDefault() + const value = getIn(json, selection.path) if (isUrl(value)) { diff --git a/src/lib/components/modes/treemode/TreeMode.svelte b/src/lib/components/modes/treemode/TreeMode.svelte index 863d2049..ba3d5c2c 100644 --- a/src/lib/components/modes/treemode/TreeMode.svelte +++ b/src/lib/components/modes/treemode/TreeMode.svelte @@ -1504,6 +1504,7 @@ const parent = getIn(json, initial(path)) if (Array.isArray(parent)) { // change into selection of the value + event.preventDefault() selection = createValueSelection(path) } } diff --git a/src/routes/components/EditableValueInput.svelte b/src/routes/components/EditableValueInput.svelte index f1d6ee1c..ec9ced4d 100644 --- a/src/routes/components/EditableValueInput.svelte +++ b/src/routes/components/EditableValueInput.svelte @@ -77,10 +77,12 @@ event.stopPropagation() if (event.key === 'Enter') { + event.preventDefault() apply() } if (event.key === 'Escape') { + event.preventDefault() cancel() } } diff --git a/src/routes/development/+page.svelte b/src/routes/development/+page.svelte index 520c37be..e367ab9c 100644 --- a/src/routes/development/+page.svelte +++ b/src/routes/development/+page.svelte @@ -726,35 +726,37 @@