@apia/components 4.0.79 → 4.0.80
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/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -5585,7 +5585,6 @@ const ListboxItem = memo(
|
|
|
5585
5585
|
),
|
|
5586
5586
|
onMouseDown: useCallback(
|
|
5587
5587
|
(ev) => {
|
|
5588
|
-
console.log("onMouseDown");
|
|
5589
5588
|
onClickNode?.({
|
|
5590
5589
|
...ev,
|
|
5591
5590
|
target: ev.target.closest(
|
|
@@ -6312,7 +6311,6 @@ function useIndexedChildren(children, listboxActions) {
|
|
|
6312
6311
|
function useListboxAutofocus(storeId, getState) {
|
|
6313
6312
|
return {
|
|
6314
6313
|
onClick: useCallback(() => {
|
|
6315
|
-
console.log("onMouseDown useListboxAutofocus");
|
|
6316
6314
|
if (document.activeElement !== document.querySelector(`#${storeId} .listbox__list`)) {
|
|
6317
6315
|
const el = document.querySelector(
|
|
6318
6316
|
`#${storeId} .listbox__list`
|
|
@@ -6331,13 +6329,8 @@ function useListboxAutofocus(storeId, getState) {
|
|
|
6331
6329
|
`#${storeId} .listbox__list .listbox__row:nth-child(${focusedRowId})`
|
|
6332
6330
|
);
|
|
6333
6331
|
if (focusedRow) {
|
|
6334
|
-
focusedRow.scrollIntoView({
|
|
6335
|
-
behavior: "auto",
|
|
6336
|
-
block: "nearest",
|
|
6337
|
-
inline: "nearest"
|
|
6338
|
-
});
|
|
6339
6332
|
const scrollContainer = findScrollContainer(focusedRow);
|
|
6340
|
-
if (scrollContainer && scrollContainer
|
|
6333
|
+
if (scrollContainer && scrollContainer.classList.contains("listbox")) {
|
|
6341
6334
|
scrollContainer.scrollIntoView({
|
|
6342
6335
|
behavior: "auto",
|
|
6343
6336
|
block: "nearest",
|
|
@@ -6348,6 +6341,11 @@ function useListboxAutofocus(storeId, getState) {
|
|
|
6348
6341
|
if (elRect.top - contRect.top < elRect.height)
|
|
6349
6342
|
scrollContainer.scrollTop -= elRect.height;
|
|
6350
6343
|
}
|
|
6344
|
+
focusedRow.scrollIntoView({
|
|
6345
|
+
behavior: "auto",
|
|
6346
|
+
block: "nearest",
|
|
6347
|
+
inline: "nearest"
|
|
6348
|
+
});
|
|
6351
6349
|
}
|
|
6352
6350
|
}, [getState, storeId])
|
|
6353
6351
|
};
|