@gitlab/ui 64.6.1 → 64.7.0

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,3 +1,17 @@
1
+ # [64.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.6.2...v64.7.0) (2023-06-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * **Type:** add line-height and letter-spacing mixins for headings ([ae1fef5](https://gitlab.com/gitlab-org/gitlab-ui/commit/ae1fef5d70c78f869b56297cd36e9861e123507a))
7
+
8
+ ## [64.6.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.6.1...v64.6.2) (2023-06-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **dropdowns:** fix ResizeObserver loop error ([a4797a5](https://gitlab.com/gitlab-org/gitlab-ui/commit/a4797a5624505d6d4aa2d539fd589bbd2b610aee))
14
+
1
15
  ## [64.6.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.6.0...v64.6.1) (2023-06-08)
2
16
 
3
17
 
@@ -137,6 +137,7 @@ var script = {
137
137
  },
138
138
  data() {
139
139
  return {
140
+ openedYet: false,
140
141
  visible: false,
141
142
  baseDropdownId: uniqueId('base-dropdown-')
142
143
  };
@@ -207,8 +208,8 @@ var script = {
207
208
  return {
208
209
  'gl-display-block!': this.visible,
209
210
  [FIXED_WIDTH_CLASS]: !this.fluidWidth,
210
- 'gl-fixed': this.isFixed,
211
- 'gl-absolute': !this.isFixed
211
+ 'gl-fixed': this.openedYet && this.isFixed,
212
+ 'gl-absolute': this.openedYet && !this.isFixed
212
213
  };
213
214
  },
214
215
  isFixed() {
@@ -271,26 +272,22 @@ var script = {
271
272
  childList: true,
272
273
  subtree: true
273
274
  });
274
- await new Promise(resolve => {
275
- const stopAutoUpdate = autoUpdate(this.toggleElement, this.$refs.content, async () => {
276
- const {
277
- x,
278
- y
279
- } = await computePosition(this.toggleElement, this.$refs.content, this.floatingUIConfig);
275
+ this.stopAutoUpdate = autoUpdate(this.toggleElement, this.$refs.content, async () => {
276
+ const {
277
+ x,
278
+ y
279
+ } = await computePosition(this.toggleElement, this.$refs.content, this.floatingUIConfig);
280
280
 
281
- /**
282
- * Due to the asynchronous nature of computePosition, it's technically possible for the
283
- * component to have been destroyed by the time the promise resolves. In such case, we exit
284
- * early to prevent a TypeError.
285
- */
286
- if (!this.$refs.content) return;
287
- Object.assign(this.$refs.content.style, {
288
- left: `${x}px`,
289
- top: `${y}px`
290
- });
291
- resolve(stopAutoUpdate);
281
+ /**
282
+ * Due to the asynchronous nature of computePosition, it's technically possible for the
283
+ * component to have been destroyed by the time the promise resolves. In such case, we exit
284
+ * early to prevent a TypeError.
285
+ */
286
+ if (!this.$refs.content) return;
287
+ Object.assign(this.$refs.content.style, {
288
+ left: `${x}px`,
289
+ top: `${y}px`
292
290
  });
293
- this.stopAutoUpdate = stopAutoUpdate;
294
291
  });
295
292
  },
296
293
  stopFloating() {
@@ -303,13 +300,13 @@ var script = {
303
300
  if (this.visible) {
304
301
  // The dropdown needs to be actually visible before we compute its position with Floating UI.
305
302
  await this.$nextTick();
306
-
303
+ this.openedYet = true;
307
304
  /**
308
305
  * We wait until the dropdown's position has been computed before emitting the `shown` event.
309
306
  * This ensures that, if the parent component attempts to focus an inner element, the dropdown
310
307
  * is already properly placed in the page. Otherwise, the page would scroll back to the top.
311
308
  */
312
- await this.startFloating();
309
+ this.startFloating();
313
310
  this.$emit(GL_DROPDOWN_SHOWN);
314
311
  } else {
315
312
  this.stopFloating();