From bc94f3deddcd22c64ea4208db0eb6b3387a6f9a0 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Thu, 3 Oct 2024 19:35:45 +0000 Subject: [PATCH 1/6] Fix scrollable listbox not focusing first item --- content/patterns/listbox/examples/js/listbox.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/patterns/listbox/examples/js/listbox.js b/content/patterns/listbox/examples/js/listbox.js index 632063f25c..6475933057 100644 --- a/content/patterns/listbox/examples/js/listbox.js +++ b/content/patterns/listbox/examples/js/listbox.js @@ -59,6 +59,8 @@ aria.Listbox = class Listbox { if (this.activeDescendant) { const listitem = document.getElementById(this.activeDescendant); listitem.scrollIntoView({ block: 'nearest', inline: 'nearest' }); + } else { + this.focusFirstItem(); } } From 871c007ea48ad6a918fc7d2aadb8cd5d781d8aea Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Mon, 28 Oct 2024 13:24:06 +0000 Subject: [PATCH 2/6] fixup! Fix scrollable listbox not focusing first item --- content/patterns/listbox/examples/listbox-scrollable.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/patterns/listbox/examples/listbox-scrollable.html b/content/patterns/listbox/examples/listbox-scrollable.html index 2ab524eb67..1e55943467 100644 --- a/content/patterns/listbox/examples/listbox-scrollable.html +++ b/content/patterns/listbox/examples/listbox-scrollable.html @@ -53,6 +53,10 @@

Example

Transuranium elements:
    +
  • + + None +
  • Neptunium From 050fda271a20ec7c865a8890ad36fbae10477858 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Mon, 28 Oct 2024 13:25:44 +0000 Subject: [PATCH 3/6] fixup! Fix scrollable listbox not focusing first item --- content/patterns/listbox/examples/listbox-scrollable.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/patterns/listbox/examples/listbox-scrollable.html b/content/patterns/listbox/examples/listbox-scrollable.html index 1e55943467..2bf7a9a17a 100644 --- a/content/patterns/listbox/examples/listbox-scrollable.html +++ b/content/patterns/listbox/examples/listbox-scrollable.html @@ -53,7 +53,7 @@

    Example

    Transuranium elements:
      -
    • +
    • None
    • From 48344fad179fe5f08182bd6f1153beaa8188a50c Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Thu, 31 Oct 2024 14:51:41 +0000 Subject: [PATCH 4/6] fixup! Fix scrollable listbox not focusing first item --- test/tests/listbox_scrollable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tests/listbox_scrollable.js b/test/tests/listbox_scrollable.js index d33b474880..0833149317 100644 --- a/test/tests/listbox_scrollable.js +++ b/test/tests/listbox_scrollable.js @@ -12,8 +12,8 @@ const ex = { listboxSelector: '#ex [role="listbox"]', optionSelector: '#ex [role="option"]', spanSelector: '#ex [role="option"] span.checkmark', - numOptions: 26, - firstOptionSelector: '#ex #ss_elem_Np', + numOptions: 27, + firstOptionSelector: '#ex #ss_elem_None', }; // Attributes From 953e40963bd433da473b8388527a99406976171e Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Wed, 6 Nov 2024 01:34:04 +0000 Subject: [PATCH 5/6] fixup! Fix scrollable listbox not focusing first item --- .../examples/js/listbox-collapsible.js | 1 - .../listbox/examples/listbox-collapsible.html | 1 + test/tests/listbox_collapsible.js | 38 ++++++++++--------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/content/patterns/listbox/examples/js/listbox-collapsible.js b/content/patterns/listbox/examples/js/listbox-collapsible.js index 4beaae9f5c..4002d17a45 100644 --- a/content/patterns/listbox/examples/js/listbox-collapsible.js +++ b/content/patterns/listbox/examples/js/listbox-collapsible.js @@ -53,7 +53,6 @@ class ListboxButton { case 'ArrowDown': evt.preventDefault(); this.showListbox(); - this.listbox.checkKeyPress(evt); break; } } diff --git a/content/patterns/listbox/examples/listbox-collapsible.html b/content/patterns/listbox/examples/listbox-collapsible.html index 5fa5958390..8a8a726db5 100644 --- a/content/patterns/listbox/examples/listbox-collapsible.html +++ b/content/patterns/listbox/examples/listbox-collapsible.html @@ -66,6 +66,7 @@

      Example