@digitransit-component/digitransit-component-autosuggest 11.0.8 → 11.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.development.cjs +9 -2
- package/lib/index.js +8 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -5
package/lib/index.js
CHANGED
|
@@ -16240,6 +16240,13 @@ function DTAutosuggest({
|
|
|
16240
16240
|
});
|
|
16241
16241
|
}
|
|
16242
16242
|
}, [state.renderMobile, isOpen]);
|
|
16243
|
+
|
|
16244
|
+
// Downshift keeps highlightedIndex when the suggestions change, and the
|
|
16245
|
+
// menu is hidden on mobile, so the highlighted item may not be shown.
|
|
16246
|
+
const activeItemHidden = isMobile || highlightedIndex >= state.suggestions.length;
|
|
16247
|
+
const getComboboxInputProps = props => getInputProps(_objectSpread(_objectSpread({}, props), activeItemHidden && {
|
|
16248
|
+
'aria-activedescendant': undefined
|
|
16249
|
+
}));
|
|
16243
16250
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
16244
16251
|
children: [isMobile && /*#__PURE__*/jsx(MobileView, {
|
|
16245
16252
|
placeholder: t(placeholder, {
|
|
@@ -16287,7 +16294,7 @@ function DTAutosuggest({
|
|
|
16287
16294
|
})).concat(' ').concat(ariaLabelText),
|
|
16288
16295
|
id: id,
|
|
16289
16296
|
lng: lng,
|
|
16290
|
-
getInputProps:
|
|
16297
|
+
getInputProps: getComboboxInputProps,
|
|
16291
16298
|
getLabelProps: getLabelProps,
|
|
16292
16299
|
selectItem: selectItem,
|
|
16293
16300
|
value: state.value,
|