@mintjamsinc/ichigojs 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11393,23 +11393,27 @@ class VOnDirective {
11393
11393
  this.#listener = (event) => {
11394
11394
  // Check key modifiers for keyboard events
11395
11395
  if (event instanceof KeyboardEvent) {
11396
- const keyModifiers = ['enter', 'tab', 'delete', 'esc', 'space', 'up', 'down', 'left', 'right'];
11397
- const hasKeyModifier = keyModifiers.some(key => this.#modifiers.has(key));
11396
+ // Map of modifier alias -> KeyboardEvent.key values it matches.
11397
+ // Multiple values allow a single modifier to match several physical keys
11398
+ // (e.g. `.delete` matches both Delete and Backspace, matching Vue's behavior).
11399
+ // Multiple aliases pointing to the same key are allowed (e.g. `.esc` / `.escape`).
11400
+ const keyMap = {
11401
+ 'enter': ['Enter'],
11402
+ 'tab': ['Tab'],
11403
+ 'delete': ['Delete', 'Backspace'],
11404
+ 'esc': ['Escape'],
11405
+ 'escape': ['Escape'],
11406
+ 'space': [' '],
11407
+ 'up': ['ArrowUp'],
11408
+ 'down': ['ArrowDown'],
11409
+ 'left': ['ArrowLeft'],
11410
+ 'right': ['ArrowRight']
11411
+ };
11412
+ const hasKeyModifier = Object.keys(keyMap).some(key => this.#modifiers.has(key));
11398
11413
  if (hasKeyModifier) {
11399
- const keyMap = {
11400
- 'enter': 'Enter',
11401
- 'tab': 'Tab',
11402
- 'delete': 'Delete',
11403
- 'esc': 'Escape',
11404
- 'space': ' ',
11405
- 'up': 'ArrowUp',
11406
- 'down': 'ArrowDown',
11407
- 'left': 'ArrowLeft',
11408
- 'right': 'ArrowRight'
11409
- };
11410
11414
  let keyMatched = false;
11411
- for (const [modifier, keyValue] of Object.entries(keyMap)) {
11412
- if (this.#modifiers.has(modifier) && event.key === keyValue) {
11415
+ for (const [modifier, keyValues] of Object.entries(keyMap)) {
11416
+ if (this.#modifiers.has(modifier) && keyValues.includes(event.key)) {
11413
11417
  keyMatched = true;
11414
11418
  break;
11415
11419
  }