mirror of
https://github.com/rxliuli/apps.apple.com.git
synced 2025-11-09 23:00:32 +00:00
init commit
This commit is contained in:
5
shared/components/src/actions/focus-node-on-mount.ts
Normal file
5
shared/components/src/actions/focus-node-on-mount.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export function focusNodeOnMount(node: HTMLElement) {
|
||||
// Wrapping in queueMicrotask ensures the node is attached to the
|
||||
// DOM before attempting to focus.
|
||||
queueMicrotask(() => node.focus());
|
||||
}
|
||||
Reference in New Issue
Block a user