Verified Commit 3d947d4c authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3038336 by bnjmnm, andrewmacpherson: When jQuery UI constrains tabbing...

Issue #3038336 by bnjmnm, andrewmacpherson: When jQuery UI constrains tabbing it does not consider summary elements
parent f9bd8c7e
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -11,17 +11,6 @@
          'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 11.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730',
      });

      // The tabbable library considers the summary element tabbable, and also
      // considers a details element without a summary tabbable. The jQuery UI
      // :tabbable selector does not. This is due to those element types being
      // inert in IE/Edge.
      // @see https://allyjs.io/data-tables/focusable.html
      if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') {
        const tabIndex = element.getAttribute('tabIndex');
        if (tabIndex === null || tabIndex < 0) {
          return false;
        }
      }
      return isTabbable(element);
    },
  });
+4 −4
Original line number Diff line number Diff line
@@ -58,13 +58,13 @@ const tabbableTestScenarios = [
  },
  {
    element:
      '<details><summary>I am not :tabbable because IE does not support it</summary>This is unfortunate</details>',
    tabbable: 0,
      '<details><summary>Summary is now tabbable because IE is not supported anymore</summary>Hooray</details>',
    tabbable: 1,
  },
  {
    element:
      '<details>A details without a summary should also not be :tabbable</details>',
    tabbable: 0,
      '<details>A details without a summary should be :tabbable</details>',
    tabbable: 1,
  },
  {
    element: '<ul><li>List item</li></ul>',