@fluid-topics/ft-select 1.2.24 → 1.2.26

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.
@@ -8,13 +8,12 @@ import { html } from "lit";
8
8
  import { property, query, state } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
10
  import { repeat } from "lit/directives/repeat.js";
11
- import { deepEqual, FtLitElement } from "@fluid-topics/ft-wc-utils";
11
+ import { computeFlipOffsetPosition, deepEqual, FtLitElement } from "@fluid-topics/ft-wc-utils";
12
12
  import { FtTypography, FtTypographyBody2, FtTypographyCaption } from "@fluid-topics/ft-typography";
13
13
  import { FtInputLabel } from "@fluid-topics/ft-input-label";
14
14
  import { FtRipple } from "@fluid-topics/ft-ripple";
15
15
  import { FtIcon } from "@fluid-topics/ft-icon";
16
16
  import { styles } from "./ft-select.styles";
17
- import { computeOffsetPosition } from "@fluid-topics/ft-wc-utils/build/floating";
18
17
  class FtSelectOption extends FtLitElement {
19
18
  constructor() {
20
19
  super(...arguments);
@@ -153,7 +152,8 @@ class FtSelect extends FtLitElement {
153
152
  }
154
153
  if (props.has("optionsDisplayed") && this.hasOptionsMenuOpen) {
155
154
  this.optionsMenu.style.width = this.mainPanel.getBoundingClientRect().width + "px";
156
- computeOffsetPosition(this.mainPanel, this.optionsMenu, "bottom")
155
+ const fallbackPlacements = ["bottom", "top"];
156
+ computeFlipOffsetPosition(this.mainPanel, this.optionsMenu, "bottom", fallbackPlacements, "fixed")
157
157
  .then(({ x, y }) => {
158
158
  this.optionsMenu.style.left = `${x}px`;
159
159
  this.optionsMenu.style.top = `${y}px`;