@vectramindnpm/unified-design-system 0.2.0 → 0.2.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/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2331,8 +2331,17 @@ var ScrollToFieldError = () => {
|
|
|
2331
2331
|
const errorKeys = Object.keys(errors);
|
|
2332
2332
|
if (errorKeys.length === 0) return;
|
|
2333
2333
|
const firstErrorKey = errorKeys[0];
|
|
2334
|
-
const
|
|
2335
|
-
if (!
|
|
2334
|
+
const rawEl = document.querySelector(`[name="${firstErrorKey}"]`) || document.getElementById(firstErrorKey);
|
|
2335
|
+
if (!rawEl) return;
|
|
2336
|
+
const isRenderedEl = (node) => node.offsetParent !== null || node === document.body;
|
|
2337
|
+
let el = rawEl;
|
|
2338
|
+
if (!isRenderedEl(rawEl)) {
|
|
2339
|
+
let ancestor = rawEl.parentElement;
|
|
2340
|
+
while (ancestor && !isRenderedEl(ancestor)) {
|
|
2341
|
+
ancestor = ancestor.parentElement;
|
|
2342
|
+
}
|
|
2343
|
+
if (ancestor) el = ancestor;
|
|
2344
|
+
}
|
|
2336
2345
|
const scrollable = el.closest(".edit-panel__body") || el.closest(".dept-modal__panel-backdrop") || el.closest(".dept-modal__backdrop") || el.closest("[class*='overflow-y-auto']");
|
|
2337
2346
|
if (scrollable && scrollable.id !== "scroll") {
|
|
2338
2347
|
const elRect = el.getBoundingClientRect();
|