@veritree/ui 0.84.0 → 0.84.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.
@@ -139,12 +139,7 @@ export const floatingUiMixin = {
139
139
  const content = document.getElementById(this.componentContent.id);
140
140
  const minWidthLimit = Number(this.floatingUiMinWidth);
141
141
 
142
- if (
143
- this.top !== null ||
144
- this.top !== undefined ||
145
- this.left !== null ||
146
- this.left !== undefined
147
- ) {
142
+ if (this.top || this.left) {
148
143
  this.positionContentToTriggerByTopAndLeft(
149
144
  trigger,
150
145
  content,
@@ -153,29 +148,31 @@ export const floatingUiMixin = {
153
148
  return;
154
149
  }
155
150
 
156
- computePosition(trigger, content, {
157
- placement: this.placement,
158
- middleware: [
159
- offset(Number(this.offset)),
160
- flip(),
161
- shift({ padding: 5 }),
162
- size({
163
- apply({ rects }) {
164
- if (!minWidthLimit) return;
165
-
166
- const width = rects.reference.width;
167
- const minWidth = width < minWidthLimit ? minWidthLimit : width;
168
-
169
- Object.assign(content.style, {
170
- minWidth: `${minWidth}px`,
171
- });
172
- },
173
- }),
174
- ],
175
- }).then(({ x, y }) => {
176
- Object.assign(content.style, {
177
- left: `${x}px`,
178
- top: `${y}px`,
151
+ this.floatingUiUpdaterDisposer = autoUpdate(trigger, content, () => {
152
+ computePosition(trigger, content, {
153
+ placement: this.placement,
154
+ middleware: [
155
+ offset(Number(this.offset)),
156
+ flip(),
157
+ shift({ padding: 5 }),
158
+ size({
159
+ apply({ rects }) {
160
+ if (!minWidthLimit) return;
161
+
162
+ const width = rects.reference.width;
163
+ const minWidth = width < minWidthLimit ? minWidthLimit : width;
164
+
165
+ Object.assign(content.style, {
166
+ minWidth: `${minWidth}px`,
167
+ });
168
+ },
169
+ }),
170
+ ],
171
+ }).then(({ x, y }) => {
172
+ Object.assign(content.style, {
173
+ left: `${x}px`,
174
+ top: `${y}px`,
175
+ });
179
176
  });
180
177
  });
181
178
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/ui",
3
- "version": "0.84.0",
3
+ "version": "0.84.1",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",