(element: FocusableElement | null, scroll = false)
| 523 | } |
| 524 | |
| 525 | function focusElement(element: FocusableElement | null, scroll = false) { |
| 526 | if (element != null && !scroll) { |
| 527 | try { |
| 528 | focusSafely(element); |
| 529 | } catch { |
| 530 | // ignore |
| 531 | } |
| 532 | } else if (element != null) { |
| 533 | try { |
| 534 | element.focus(); |
| 535 | } catch { |
| 536 | // ignore |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | |
| 541 | function getFirstInScope(scope: Element[], tabbable = true) { |
| 542 | let sentinel = scope[0].previousElementSibling!; |
no test coverage detected