(preventScroll = false)
| 54 | |
| 55 | /* eslint-disable no-console */ |
| 56 | export function returnFocus(preventScroll = false) { |
| 57 | let toFocus = null; |
| 58 | try { |
| 59 | if (focusLaterElements.length !== 0) { |
| 60 | toFocus = focusLaterElements.pop(); |
| 61 | toFocus.focus({ preventScroll }); |
| 62 | } |
| 63 | return; |
| 64 | } catch (e) { |
| 65 | console.warn( |
| 66 | [ |
| 67 | "You tried to return focus to", |
| 68 | toFocus, |
| 69 | "but it is not in the DOM anymore" |
| 70 | ].join(" ") |
| 71 | ); |
| 72 | } |
| 73 | } |
| 74 | /* eslint-enable no-console */ |
| 75 | |
| 76 | export function popWithoutFocus() { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…