@ai-matrx/canvas 0.8.0 → 0.8.1

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/react.js CHANGED
@@ -3249,8 +3249,9 @@ function TabStrip({
3249
3249
  if (!el || !activeItemId) return;
3250
3250
  const tab = [...el.querySelectorAll("[data-mxc-tab]")].find((node) => node.dataset.mxcTab === activeItemId);
3251
3251
  if (!tab) return;
3252
+ const target = tab.closest(".mxc-tab-group") ?? tab;
3252
3253
  const box = el.getBoundingClientRect();
3253
- const rect = tab.getBoundingClientRect();
3254
+ const rect = target.getBoundingClientRect();
3254
3255
  if (rect.left < box.left) el.scrollLeft -= box.left - rect.left;
3255
3256
  else if (rect.right > box.right) el.scrollLeft += rect.right - box.right;
3256
3257
  }, [activeItemId, width, tabs.length]);