@depup/testing-library__user-event 14.6.3-depup.0 → 14.6.5-depup.0

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.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/testing-library__user-event
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@testing-library/user-event](https://www.npmjs.com/package/@testing-library/user-event) @ 14.6.3 |
17
- | Processed | 2026-08-04 |
16
+ | Original | [@testing-library/user-event](https://www.npmjs.com/package/@testing-library/user-event) @ 14.6.5 |
17
+ | Processed | 2026-08-18 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-08-04T00:39:39.331Z",
3
+ "timestamp": "2026-08-18T08:10:26.817Z",
4
4
  "totalUpdated": 0
5
5
  }
@@ -6,6 +6,7 @@ var isElementType = require('../../utils/misc/isElementType.js');
6
6
  require('../../utils/dataTransfer/Clipboard.js');
7
7
  var isContentEditable = require('../../utils/edit/isContentEditable.js');
8
8
  var isEditable = require('../../utils/edit/isEditable.js');
9
+ var getActiveElement = require('../../utils/focus/getActiveElement.js');
9
10
  var getTabDestination = require('../../utils/focus/getTabDestination.js');
10
11
  var selection = require('../../utils/focus/selection.js');
11
12
  var focus = require('../focus.js');
@@ -110,7 +111,9 @@ const keydownBehavior = {
110
111
  },
111
112
  Tab: (event, target, instance)=>{
112
113
  return ()=>{
113
- const dest = getTabDestination.getTabDestination(target, instance.system.keyboard.modifiers.Shift);
114
+ const dest = getTabDestination.getTabDestination(// get target here because target would be stale, it's the element that keydown happened on, but
115
+ // focus may have been moved to another element so that browser tab behaviour picks up from there
116
+ getActiveElement.getActiveElementOrBody(instance.config.document), instance.system.keyboard.modifiers.Shift);
114
117
  focus.focusElement(dest);
115
118
  if (selection.hasOwnSelection(dest)) {
116
119
  UI.setUISelection(dest, {
@@ -19,7 +19,7 @@ async function keyboardAction(instance, { keyDef, releasePrevious, releaseSelf,
19
19
  }
20
20
  if (!releasePrevious) {
21
21
  for(let i = 1; i <= repeat; i++){
22
- await system.keyboard.keydown(instance, keyDef);
22
+ await system.keyboard.keydown(instance, keyDef, i > 1);
23
23
  if (i < repeat) {
24
24
  await wait.wait(instance.config);
25
25
  }
@@ -50,7 +50,7 @@ class KeyboardHost {
50
50
  getPressedKeys() {
51
51
  return this.pressed.values().map((p)=>p.keyDef);
52
52
  }
53
- /** Press a key */ async keydown(instance, keyDef) {
53
+ /** Press a key */ async keydown(instance, keyDef, repeat = false) {
54
54
  const key = String(keyDef.key);
55
55
  const code = String(keyDef.code);
56
56
  const target = getActiveElement.getActiveElementOrBody(instance.config.document);
@@ -61,7 +61,8 @@ class KeyboardHost {
61
61
  }
62
62
  const unprevented = instance.dispatchUIEvent(target, 'keydown', {
63
63
  key,
64
- code
64
+ code,
65
+ repeat
65
66
  });
66
67
  if (isModifierLock(key) && !this.modifiers[key]) {
67
68
  this.modifiers[key] = true;
@@ -4,6 +4,7 @@ import { isElementType } from '../../utils/misc/isElementType.js';
4
4
  import '../../utils/dataTransfer/Clipboard.js';
5
5
  import { isContentEditable } from '../../utils/edit/isContentEditable.js';
6
6
  import { isEditable } from '../../utils/edit/isEditable.js';
7
+ import { getActiveElementOrBody } from '../../utils/focus/getActiveElement.js';
7
8
  import { getTabDestination } from '../../utils/focus/getTabDestination.js';
8
9
  import { hasOwnSelection } from '../../utils/focus/selection.js';
9
10
  import { focusElement } from '../focus.js';
@@ -108,7 +109,9 @@ const keydownBehavior = {
108
109
  },
109
110
  Tab: (event, target, instance)=>{
110
111
  return ()=>{
111
- const dest = getTabDestination(target, instance.system.keyboard.modifiers.Shift);
112
+ const dest = getTabDestination(// get target here because target would be stale, it's the element that keydown happened on, but
113
+ // focus may have been moved to another element so that browser tab behaviour picks up from there
114
+ getActiveElementOrBody(instance.config.document), instance.system.keyboard.modifiers.Shift);
112
115
  focusElement(dest);
113
116
  if (hasOwnSelection(dest)) {
114
117
  setUISelection(dest, {
@@ -17,7 +17,7 @@ async function keyboardAction(instance, { keyDef, releasePrevious, releaseSelf,
17
17
  }
18
18
  if (!releasePrevious) {
19
19
  for(let i = 1; i <= repeat; i++){
20
- await system.keyboard.keydown(instance, keyDef);
20
+ await system.keyboard.keydown(instance, keyDef, i > 1);
21
21
  if (i < repeat) {
22
22
  await wait(instance.config);
23
23
  }
@@ -48,7 +48,7 @@ class KeyboardHost {
48
48
  getPressedKeys() {
49
49
  return this.pressed.values().map((p)=>p.keyDef);
50
50
  }
51
- /** Press a key */ async keydown(instance, keyDef) {
51
+ /** Press a key */ async keydown(instance, keyDef, repeat = false) {
52
52
  const key = String(keyDef.key);
53
53
  const code = String(keyDef.code);
54
54
  const target = getActiveElementOrBody(instance.config.document);
@@ -59,7 +59,8 @@ class KeyboardHost {
59
59
  }
60
60
  const unprevented = instance.dispatchUIEvent(target, 'keydown', {
61
61
  key,
62
- code
62
+ code,
63
+ repeat
63
64
  });
64
65
  if (isModifierLock(key) && !this.modifiers[key]) {
65
66
  this.modifiers[key] = true;
@@ -42,7 +42,7 @@ export declare class KeyboardHost {
42
42
  isKeyPressed(keyDef: keyboardKey): boolean;
43
43
  getPressedKeys(): keyboardKey[];
44
44
  /** Press a key */
45
- keydown(instance: Instance, keyDef: keyboardKey): Promise<void>;
45
+ keydown(instance: Instance, keyDef: keyboardKey, repeat?: boolean): Promise<void>;
46
46
  /** Release a key */
47
47
  keyup(instance: Instance, keyDef: keyboardKey): Promise<void>;
48
48
  private setKeydownTarget;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/testing-library__user-event",
3
- "version": "14.6.3-depup.0",
3
+ "version": "14.6.5-depup.0",
4
4
  "description": "Fire events the same way the user does (with updated dependencies)",
5
5
  "keywords": [
6
6
  "@testing-library/user-event",
@@ -124,8 +124,8 @@
124
124
  "changes": {},
125
125
  "depsUpdated": 0,
126
126
  "originalPackage": "@testing-library/user-event",
127
- "originalVersion": "14.6.3",
128
- "processedAt": "2026-08-04T00:40:07.618Z",
127
+ "originalVersion": "14.6.5",
128
+ "processedAt": "2026-08-18T08:10:53.133Z",
129
129
  "smokeTest": "failed"
130
130
  }
131
131
  }