Caleb Porzio преди 2 години
родител
ревизия
53dc53aa7d
променени са 1 файла, в които са добавени 7 реда и са изтрити 1 реда
  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...
         'role': 'option',
         ':tabindex'() { return this.$comboboxOption.isDisabled ? undefined : '-1' },
+
         // 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 },
 
         // Initialize...