@apia/components 4.0.78 → 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 CHANGED
@@ -6329,13 +6329,8 @@ function useListboxAutofocus(storeId, getState) {
6329
6329
  `#${storeId} .listbox__list .listbox__row:nth-child(${focusedRowId})`
6330
6330
  );
6331
6331
  if (focusedRow) {
6332
- focusedRow.scrollIntoView({
6333
- behavior: "auto",
6334
- block: "nearest",
6335
- inline: "nearest"
6336
- });
6337
6332
  const scrollContainer = findScrollContainer(focusedRow);
6338
- if (scrollContainer && scrollContainer !== document.body) {
6333
+ if (scrollContainer && scrollContainer.classList.contains("listbox")) {
6339
6334
  scrollContainer.scrollIntoView({
6340
6335
  behavior: "auto",
6341
6336
  block: "nearest",
@@ -6346,6 +6341,11 @@ function useListboxAutofocus(storeId, getState) {
6346
6341
  if (elRect.top - contRect.top < elRect.height)
6347
6342
  scrollContainer.scrollTop -= elRect.height;
6348
6343
  }
6344
+ focusedRow.scrollIntoView({
6345
+ behavior: "auto",
6346
+ block: "nearest",
6347
+ inline: "nearest"
6348
+ });
6349
6349
  }
6350
6350
  }, [getState, storeId])
6351
6351
  };