Edit JSON node settings in a dialog from a one-line preview
A free setting typed json and a declared object or array setting (a Switch node's rules, HTTP headers) show one line of their value; clicking opens a Monaco JSON editor in a dialog that saves only once the text parses. Declared object settings were not shown at all before. Escape in a dialog opened from a side panel no longer closes the panel too.
This commit is contained in:
@@ -228,7 +228,9 @@ export function SidePanel({
|
||||
useEffect(() => {
|
||||
if (!open) return
|
||||
const onKey = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape") onClose()
|
||||
// A dialog opened from the panel closes on its own Escape and marks it
|
||||
// handled; that one press should not take the panel with it.
|
||||
if (event.key === "Escape" && !event.defaultPrevented) onClose()
|
||||
}
|
||||
window.addEventListener("keydown", onKey)
|
||||
return () => window.removeEventListener("keydown", onKey)
|
||||
|
||||
Reference in New Issue
Block a user