mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-30 08:16:49 +00:00
fix(frontend): allow copy/paste shortcuts inside ConfirmationModal (#9505)
The modal's window keydown-capture handler called preventDefault() and stopPropagation() on every keystroke while open, which swallowed Cmd/Ctrl+C and Cmd/Ctrl+V (and blocked typing in any child input). Only intercept Enter/Escape without modifiers and let all other keys through. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
08da7a121b
commit
7fc5340da3
@@ -41,14 +41,21 @@
|
||||
|
||||
function onKeyDown(event: KeyboardEvent) {
|
||||
if (open && keyListen) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
// Only intercept Enter/Escape (without modifiers) so shortcuts like
|
||||
// Cmd/Ctrl+C and Cmd/Ctrl+V keep working inside the modal.
|
||||
if (event.metaKey || event.ctrlKey || event.altKey) {
|
||||
return
|
||||
}
|
||||
switch (event.key) {
|
||||
case 'Enter':
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
dispatch('confirmed')
|
||||
onConfirmed?.()
|
||||
break
|
||||
case 'Escape':
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
dispatch('canceled')
|
||||
onCanceled?.()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user