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