You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9a9381d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(dismissable): register escape handler as soon as the node commits
trackDismissableElement deferred its entire body by one animation frame
when defer: true, so a dialog was painted and focus-trapped before the
layer reached layerStack and before trackEscapeKeydown was attached. An
Escape sent in that window did nothing, and under CPU load the window
stretched well past a frame.
Resolving the node eagerly does not help on its own: machine effects run
before the framework commits its DOM, so the node is always null at call
time and the deferred pass is always taken. The node does commit on the
following microtask, which lands far sooner than the next frame.
whenNode (new, in dom-query) escalates sync -> microtask -> rAF and is
now used by both trackDismissableElement and trackDismissableBranch.
trackDismissableElementImpl takes a non-null node, dropping its internal
null checks and the node! assertions.
Measured on /dialog/basic: registration gap 33ms -> 0ms, and a real
Escape keypress at 6x and 20x CPU throttle went from 4/5 to 5/5.
Fixes#3248
0 commit comments