@votodigital-onpeui/react 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -629,13 +629,9 @@ var Modal = ({
629
629
  previousActiveElement.current = document.activeElement;
630
630
  const labelledById = props["aria-labelledby"];
631
631
  const focusInitial = (wrapper) => {
632
- if (labelledById) {
633
- const labelEl = document.getElementById(labelledById);
634
- if (labelEl instanceof HTMLElement) {
635
- if (!labelEl.hasAttribute("tabindex")) labelEl.setAttribute("tabindex", "-1");
636
- labelEl.focus({ preventScroll: true });
637
- return;
638
- }
632
+ if (labelledById && document.getElementById(labelledById)) {
633
+ wrapper.focus({ preventScroll: true });
634
+ return;
639
635
  }
640
636
  const focusable = getFocusableElements(wrapper);
641
637
  const first = focusable[0];