@joewinke/jatui 0.2.13 → 0.2.14
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.
|
@@ -183,10 +183,19 @@
|
|
|
183
183
|
const flipUp = spaceBelow < estPanelHeight && spaceAbove > spaceBelow;
|
|
184
184
|
// Clamp left so a right-edge trigger doesn't push the panel off-screen.
|
|
185
185
|
const left = Math.max(8, Math.min(rect.left, window.innerWidth - width - 8));
|
|
186
|
+
// .sd-panel's class rule always sets `top: 100%`, so each branch must
|
|
187
|
+
// explicitly reset the property it isn't using — otherwise the flip-up
|
|
188
|
+
// branch ends up with both top (100% = viewport height) and bottom set
|
|
189
|
+
// while height is auto, which over-constrains to a negative (clamped
|
|
190
|
+
// to 0) height and the whole panel silently renders invisible.
|
|
186
191
|
const vertical = flipUp
|
|
187
|
-
? `bottom: ${window.innerHeight - rect.top + 4}px;`
|
|
188
|
-
: `top: ${rect.bottom + 4}px;`;
|
|
189
|
-
|
|
192
|
+
? `bottom: ${window.innerHeight - rect.top + 4}px; top: auto;`
|
|
193
|
+
: `top: ${rect.bottom + 4}px; bottom: auto;`;
|
|
194
|
+
// min-width override is required: .sd-panel's class rule sets
|
|
195
|
+
// `min-width: max(100%, 14rem)`, and for a position:fixed element
|
|
196
|
+
// that 100% resolves against the viewport, not the trigger — without
|
|
197
|
+
// this override the panel balloons to ~100vw wide.
|
|
198
|
+
panelStyle = `position: fixed; z-index: 9999; ${vertical} left: ${left}px; width: ${width}px; min-width: ${width}px; margin-top: 0;`;
|
|
190
199
|
}
|
|
191
200
|
document.addEventListener('mousedown', handleClickOutside);
|
|
192
201
|
tick().then(() => { searchInput?.focus(); scrollHighlightedIntoView(); });
|