@aria-ui/listbox
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -219,2 +219,9 @@ // src/listbox-empty.element.gen.ts | ||
}); | ||
const availableValues = createComputed3(() => { | ||
const queryValue = state.query.value; | ||
const values = collection.value.getValues().filter((value) => state.filter.value({ query: queryValue, value })); | ||
return new Set(values); | ||
}); | ||
availableValueSetContext.provide(element, availableValues); | ||
const available = createComputed3(() => availableValues.value.size > 0); | ||
useCollectionKeydownHandler( | ||
@@ -225,14 +232,8 @@ element, | ||
state.value, | ||
state.onKeydownHandlerAdd | ||
state.onKeydownHandlerAdd, | ||
available | ||
); | ||
const availableValues = createComputed3(() => { | ||
const queryValue = state.query.value; | ||
const values = collection.value.getValues().filter((value) => state.filter.value({ query: queryValue, value })); | ||
console.log("values", values); | ||
return new Set(values); | ||
}); | ||
availableValueSetContext.provide(element, availableValues); | ||
return state; | ||
} | ||
function useCollectionKeydownHandler(element, collection, focusedValue, selectedValue, onKeydownHandlerAdd) { | ||
function useCollectionKeydownHandler(element, collection, focusedValue, selectedValue, onKeydownHandlerAdd, available) { | ||
const scrollFocusedItemIntoView = () => { | ||
@@ -243,3 +244,3 @@ const target = collection.peek().getElement(focusedValue.value); | ||
const keydownHandler = (event) => { | ||
if (event.defaultPrevented || event.isComposing) { | ||
if (event.defaultPrevented || event.isComposing || !available.value) { | ||
return; | ||
@@ -246,0 +247,0 @@ } |
{ | ||
"name": "@aria-ui/listbox", | ||
"type": "module", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19486
526