@lavalogic/scoria 0.37.24 → 0.37.25
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.
|
@@ -48,7 +48,11 @@
|
|
|
48
48
|
if (d == null) {
|
|
49
49
|
return undefined;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
// Use `toLocaleString` for both lines so the visual format matches
|
|
52
|
+
// (only the time zone differs). The `timeZone: 'UTC'` override on
|
|
53
|
+
// the second call renders the same date / time but reinterpreted
|
|
54
|
+
// in UTC, which is what the user expects to see on hover.
|
|
55
|
+
return `Local: ${d.toLocaleString()}\nUTC: ${d.toLocaleString(undefined, { timeZone: 'UTC' })}`;
|
|
52
56
|
});
|
|
53
57
|
|
|
54
58
|
const tableContext = getContext<TableContext<T, RowIdType>>(TableContext.identifier);
|
|
@@ -146,6 +146,10 @@ export function attachDropdownPortal(options) {
|
|
|
146
146
|
}
|
|
147
147
|
originalParent = dropdown.parentNode;
|
|
148
148
|
originalNextSibling = dropdown.nextSibling;
|
|
149
|
+
// Clear any `display: none` left over from a previous portalIn
|
|
150
|
+
// (see the defensive hide there) so the dropdown is visible
|
|
151
|
+
// once teleported into the new host.
|
|
152
|
+
dropdown.style.display = '';
|
|
149
153
|
// Append the dropdown to the nearest open native `<dialog>` ancestor
|
|
150
154
|
// when one exists, otherwise to `document.body`. A `<dialog>` opened
|
|
151
155
|
// via `showModal()` renders in the browser's top layer, which sits
|
|
@@ -200,6 +204,18 @@ export function attachDropdownPortal(options) {
|
|
|
200
204
|
dropdown.style.maxHeight = '';
|
|
201
205
|
dropdown.style.zIndex = '';
|
|
202
206
|
dropdown.removeAttribute('data-scoria-portal-dropdown');
|
|
207
|
+
// Defensive: if Svelecte left the dropdown without its own
|
|
208
|
+
// `display: none` (e.g. on certain transition-cancel race paths
|
|
209
|
+
// the open/close class flip and the inline style update arrive
|
|
210
|
+
// out of order), the dropdown would now be `position: static;
|
|
211
|
+
// display: block` in `document.body` and contribute its option
|
|
212
|
+
// list's height to the body scroll size - which is what surfaces
|
|
213
|
+
// as a stray page-level vertical scrollbar after toggling a
|
|
214
|
+
// select. Force `display: none` here; Svelecte will restore the
|
|
215
|
+
// inline style on next open via its own class-driven render.
|
|
216
|
+
if (!dropdown.classList.contains('is-open')) {
|
|
217
|
+
dropdown.style.display = 'none';
|
|
218
|
+
}
|
|
203
219
|
if (originalParent != null) {
|
|
204
220
|
if (originalNextSibling != null && originalNextSibling.parentNode === originalParent) {
|
|
205
221
|
originalParent.insertBefore(dropdown, originalNextSibling);
|