Skip to content

Commit

Permalink
fix: compare the key property as well for keyboard events
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Mar 3, 2025
1 parent c3f2be2 commit df355c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/breezy-states-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@formwerk/core': patch
---

fix: handle enter key on android firefox
2 changes: 1 addition & 1 deletion packages/core/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export function tryOnScopeDispose(fn: () => void) {
}

export function hasKeyCode(e: Event, code: string) {
return (e as KeyboardEvent).code === code;
return (e as KeyboardEvent).code === code || (e as KeyboardEvent).key === code;
}

/**
Expand Down

0 comments on commit df355c5

Please sign in to comment.