Caleb Porzio 2 years ago
parent
commit
53dc53aa7d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      packages/ui/src/combobox.js

+ 7 - 1
packages/ui/src/combobox.js

@@ -428,8 +428,14 @@ function handleOption(el, Alpine) {
         // Accessibility attributes...
         // Accessibility attributes...
         'role': 'option',
         'role': 'option',
         ':tabindex'() { return this.$comboboxOption.isDisabled ? undefined : '-1' },
         ':tabindex'() { return this.$comboboxOption.isDisabled ? undefined : '-1' },
+
         // Only the active element should have aria-selected="true"...
         // Only the active element should have aria-selected="true"...
-        'x-effect'() { this.$comboboxOption.isActive ? el.setAttribute('aria-selected', true) : el.removeAttribute('aria-selected') },
+        'x-effect'() {
+            this.$comboboxOption.isActive
+                ? el.setAttribute('aria-selected', true)
+                : el.removeAttribute('aria-selected')
+        },
+
         ':aria-disabled'() { return this.$comboboxOption.isDisabled },
         ':aria-disabled'() { return this.$comboboxOption.isDisabled },
 
 
         // Initialize...
         // Initialize...