@energysage/es-ds-components 6.3.0 → 6.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.3.1](https://github.com/EnergySage/es-ds/compare/es-ds-components-v6.3.0...es-ds-components-v6.3.1) (2026-10-12)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * EsAutocomplete now works in Safari inside a position fixed container with transform ([#1794](https://github.com/EnergySage/es-ds/issues/1794)) ([233fa49](https://github.com/EnergySage/es-ds/commit/233fa49838d3abf9fb956317c73ef920c5862c11))
9
+
3
10
  ## [6.3.0](https://github.com/EnergySage/es-ds/compare/es-ds-components-v6.2.0...es-ds-components-v6.3.0) (2026-10-07)
4
11
 
5
12
 
@@ -81,6 +81,40 @@ function positionPanel() {
81
81
  const above = supportsAnchor.value && natural > spaceBelow && natural <= spaceAbove;
82
82
  panelAbove.value = above;
83
83
  panel.style.maxHeight = `${Math.max(above ? spaceAbove : spaceBelow, 0)}px`;
84
+ alignPanel();
85
+ }
86
+
87
+ // engines disagree on where an anchor inside a transformed or fixed ancestor
88
+ // sits: Safari and Firefox resolve anchor() without the ancestor's transform, so
89
+ // a field in a fixed banner slid down by translateY gets its panel at the
90
+ // untransformed spot, over the field. the clip is checked against the field's
91
+ // real box and shifted by any difference, which is zero where anchor() is right.
92
+ let panelShift = { x: 0, y: 0 };
93
+ function alignPanel() {
94
+ const clip = wrapperEl.value;
95
+ const anchor = fieldEl.value;
96
+ if (!clip || !anchor || !supportsAnchor.value) {
97
+ return;
98
+ }
99
+ const anchorRect = anchor.getBoundingClientRect();
100
+ const clipRect = clip.getBoundingClientRect();
101
+ // the side as rendered, which can trail panelAbove until the next render; the
102
+ // error is a translation, so either edge pairing yields the same shift
103
+ const above = clip.classList.contains('es-autocomplete-clip--above');
104
+ const anchoredEdge = above ? clipRect.bottom : clipRect.top;
105
+ const x = anchorRect.left - (clipRect.left - panelShift.x);
106
+ const y = (above ? anchorRect.top : anchorRect.bottom) - (anchoredEdge - panelShift.y);
107
+ panelShift = Math.abs(x) < 0.5 && Math.abs(y) < 0.5 ? { x: 0, y: 0 } : { x, y };
108
+ clip.style.translate = panelShift.x || panelShift.y ? `${panelShift.x}px ${panelShift.y}px` : '';
109
+ }
110
+
111
+ // an ancestor's transition moves the field without a scroll or resize, as the
112
+ // banner sliding under a returning nav bar does, so its end re-aligns the panel
113
+ function onAncestorTransitionEnd(event: Event) {
114
+ const field = fieldEl.value;
115
+ if (field && event.target instanceof Node && event.target !== field && event.target.contains(field)) {
116
+ alignPanel();
117
+ }
84
118
  }
85
119
 
86
120
  const { remeasure, visibleSuggestions } = useEsAutocompleteVisibleRows(
@@ -286,13 +320,16 @@ function onDocumentPointerdown(event: Event) {
286
320
  watch(open, (isOpen) => {
287
321
  if (isOpen) {
288
322
  document.addEventListener('pointerdown', onDocumentPointerdown, true);
323
+ document.addEventListener('transitionend', onAncestorTransitionEnd, true);
289
324
  } else {
290
325
  document.removeEventListener('pointerdown', onDocumentPointerdown, true);
326
+ document.removeEventListener('transitionend', onAncestorTransitionEnd, true);
291
327
  }
292
328
  });
293
329
 
294
330
  onBeforeUnmount(() => {
295
331
  document.removeEventListener('pointerdown', onDocumentPointerdown, true);
332
+ document.removeEventListener('transitionend', onAncestorTransitionEnd, true);
296
333
  });
297
334
 
298
335
  // --- panel drawer ------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energysage/es-ds-components",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "An EnergySage Vue component library",