Skip to content

Commit 84969ab

Browse files
committed
fix(core): prevent delete action if inside input field
1 parent b0f1bf0 commit 84969ab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/core/src/composables/useKeyPress.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ export function useKeyPress(
123123
(e) => {
124124
modifierPressed = wasModifierPressed(e)
125125

126-
if (!modifierPressed && isInputDOMNode(e)) {
126+
const preventAction = (!modifierPressed || (modifierPressed && !options.actInsideInputWithModifier)) && isInputDOMNode(e)
127+
128+
if (preventAction) {
127129
return
128130
}
129131

@@ -138,7 +140,9 @@ export function useKeyPress(
138140
(...args) => currentFilter(...args),
139141
(e) => {
140142
if (isPressed.value) {
141-
if (!modifierPressed && isInputDOMNode(e)) {
143+
const preventAction = (!modifierPressed || (modifierPressed && !options.actInsideInputWithModifier)) && isInputDOMNode(e)
144+
145+
if (preventAction) {
142146
return
143147
}
144148

0 commit comments

Comments
 (0)