(el: View | null | undefined)
| 112 | const DEFAULT_MODE = 'elevated'; |
| 113 | |
| 114 | const focusFirstDOMNode = (el: View | null | undefined) => { |
| 115 | if (el && Platform.OS === 'web') { |
| 116 | // When in the browser, we want to focus the first focusable item on toggle |
| 117 | // For example, when menu is shown, focus the first item in the menu |
| 118 | // And when menu is dismissed, send focus back to the button to resume tabbing |
| 119 | if (el instanceof HTMLElement) { |
| 120 | el.querySelector<HTMLElement>( |
| 121 | // This is a rough list of selectors that can be focused |
| 122 | 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' |
| 123 | )?.focus(); |
| 124 | } |
| 125 | } |
| 126 | }; |
| 127 | |
| 128 | const isCoordinate = (anchor: any): anchor is { x: number; y: number } => |
| 129 | !React.isValidElement(anchor) && |
no outgoing calls
no test coverage detected
searching dependent graphs…