@iyulab/components 2.30.0 → 2.30.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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.30.1] - 2026-10-20
4
+
5
+ ### Fixed
6
+
7
+ - Open floating elements (`u-select`, `u-popover`, `u-tooltip`, menus, pickers) no longer stay `visibility: hidden` when the
8
+ ancestor that was clipping their anchor changes size. The anchor-hidden check only re-ran on scroll and on anchor/popup
9
+ resizes, so a collapsed section that expanded after the popup opened left the anchor fully visible and the open popup
10
+ invisible. Clipping ancestors are now observed for size changes while a popup is tracked.
11
+
3
12
  ## [2.30.0] - 2026-10-17
4
13
 
5
14
  ### Added
@@ -130,6 +130,13 @@ export declare class UFloatingElement extends UElement {
130
130
  private untrack;
131
131
  /** 타겟 기준으로 위치를 계산하고, 스크롤·리사이즈를 따라 재배치하도록 추적을 건다. */
132
132
  private track;
133
+ /**
134
+ * 앵커를 가리는 조상(overflow 클리핑)의 크기 변화를 따라 다시 잰다. `autoUpdate` 는 앵커·떠 있는 상자의 크기와
135
+ * 스크롤·리사이즈만 보므로, 클리핑 조상이 커지거나(접힌 절이 펼쳐짐) 줄어 앵커가 가려지거나 드러나도 앵커 자신은
136
+ * 움직이지 않으면 아무 신호가 없다 — 가려진 순간에 붙은 `anchor-hidden` 이 앵커가 다 드러난 뒤에도 남아 열린 팝업이
137
+ * 보이지 않았다.
138
+ */
139
+ private observeClippingAncestors;
133
140
  /**
134
141
  * 현재 엘리먼트를 표시합니다.
135
142
  *
@@ -4,7 +4,7 @@ import { styles } from "./UFloatingElement.styles.js";
4
4
  import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
5
5
  import __decorate from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
6
6
  import { property, state } from "lit/decorators.js";
7
- import { arrow, autoPlacement, autoUpdate, computePosition, flip, hide, offset, shift } from "@floating-ui/dom";
7
+ import { arrow, autoPlacement, autoUpdate, computePosition, flip, getOverflowAncestors, hide, offset, shift } from "@floating-ui/dom";
8
8
  //#region src/components/UFloatingElement.ts
9
9
  /**
10
10
  * UFloatingElement는 팝오버, 툴팁 등 화면에 떠 있는 엘리먼트를 구현하기 위한 기본 클래스입니다.
@@ -108,11 +108,31 @@ var UFloatingElement = class extends UElement {
108
108
  const seq = this.trackSeq;
109
109
  await this.reposition(target);
110
110
  if (seq !== this.trackSeq) return;
111
- this.cleanup = autoUpdate(target, this, () => {
111
+ const update = () => {
112
112
  this.reposition(target);
113
- });
113
+ };
114
+ const stopAutoUpdate = autoUpdate(target, this, update);
115
+ const stopClipObserve = this.observeClippingAncestors(target, update);
116
+ this.cleanup = () => {
117
+ stopAutoUpdate();
118
+ stopClipObserve();
119
+ };
114
120
  this.targetEl = target;
115
121
  }
122
+ /**
123
+ * 앵커를 가리는 조상(overflow 클리핑)의 크기 변화를 따라 다시 잰다. `autoUpdate` 는 앵커·떠 있는 상자의 크기와
124
+ * 스크롤·리사이즈만 보므로, 클리핑 조상이 커지거나(접힌 절이 펼쳐짐) 줄어 앵커가 가려지거나 드러나도 앵커 자신은
125
+ * 움직이지 않으면 아무 신호가 없다 — 가려진 순간에 붙은 `anchor-hidden` 이 앵커가 다 드러난 뒤에도 남아 열린 팝업이
126
+ * 보이지 않았다.
127
+ */
128
+ observeClippingAncestors(target, update) {
129
+ if (typeof ResizeObserver === "undefined") return () => {};
130
+ const context = target instanceof Element ? target : target.contextElement;
131
+ if (!context) return () => {};
132
+ const observer = new ResizeObserver(update);
133
+ for (const ancestor of getOverflowAncestors(context)) if (ancestor instanceof Element) observer.observe(ancestor);
134
+ return () => observer.disconnect();
135
+ }
116
136
  /**
117
137
  * 현재 엘리먼트를 표시합니다.
118
138
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "2.30.0",
4
+ "version": "2.30.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",