We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28923f0 commit b5564b5Copy full SHA for b5564b5
src/user-event/utils/dispatch-event.ts
@@ -1,6 +1,7 @@
1
import { ReactTestInstance } from 'react-test-renderer';
2
import act from '../../act';
3
import { isEventEnabled, isTouchResponder } from '../../fireEvent';
4
+import { flushMicroTasks } from '../../flushMicroTasks';
5
import { getHostParent } from '../../helpers/component-tree';
6
7
type EventHandler = (event: unknown) => void;
@@ -24,6 +25,7 @@ export function dispatchHostEvent(
24
25
26
act(() => {
27
handler(event);
28
+ flushMicroTasks();
29
});
30
}
31
@@ -47,6 +49,7 @@ export function dispatchOwnHostEvent(
47
49
48
50
51
52
53
54
55
0 commit comments