Skip to content

Commit

Permalink
fix(core): prevent delete action if inside input field
Browse files Browse the repository at this point in the history
  • Loading branch information
bcakmakoglu committed Apr 29, 2024
1 parent c61e1c1 commit 25b0f54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/composables/useKeyPress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export function useKeyPress(
(e) => {
modifierPressed = wasModifierPressed(e)

if (!modifierPressed && isInputDOMNode(e)) {
const preventAction = (!modifierPressed || (modifierPressed && !options.actInsideInputWithModifier)) && isInputDOMNode(e)

if (preventAction) {
return
}

Expand All @@ -138,7 +140,9 @@ export function useKeyPress(
(...args) => currentFilter(...args),
(e) => {
if (isPressed.value) {
if (!modifierPressed && isInputDOMNode(e)) {
const preventAction = (!modifierPressed || (modifierPressed && !options.actInsideInputWithModifier)) && isInputDOMNode(e)

if (preventAction) {
return
}

Expand Down

0 comments on commit 25b0f54

Please sign in to comment.