shortcut: get keyboard event / actual target #256
-
|
Hey! I am using shortcut for handling several user actions. I bind all handlers on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
@moklick hmm, I see. thank you for the question.
How do you feel about an additional function onShortcut(event) {
if (event.detail.originalEvent.target.tagName === 'INPUT') {
...
}
} |
Beta Was this translation helpful? Give feedback.
@moklick hmm, I see. thank you for the question.
shortcutis aCustomEvent, whosetargetis whatever node the Svelte action is placed on, so the observed behavior makes sense. For your use case we need to access the originalKeyboardEventobject, which is not exposed in the current version.How do you feel about an additional
originalEventin theevent.detailobject, something like this: