@reshaped/utilities 3.10.0-canary.5 → 3.10.0-canary.6

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.
@@ -56,7 +56,7 @@ const applyPosition = (args) => {
56
56
  ...result,
57
57
  fallbackAdjustLayout,
58
58
  fallbackMinHeight,
59
- width,
59
+ width: options?.width,
60
60
  flyoutBounds,
61
61
  containerBounds,
62
62
  triggerBounds: resolvedTriggerBounds,
@@ -79,7 +79,7 @@ const applyPosition = (args) => {
79
79
  let calculated = null;
80
80
  const testOrder = getPositionFallbacks(position, fallbackPositions);
81
81
  testOrder.some((currentPosition) => {
82
- const tested = testPosition(currentPosition);
82
+ const tested = testPosition(currentPosition, { width });
83
83
  const visible = testVisibility(tested);
84
84
  if (visible)
85
85
  calculated = tested;
@@ -98,7 +98,7 @@ const applyPosition = (args) => {
98
98
  }
99
99
  // None of the positions fit, use the last used position or the default position
100
100
  if (!calculated)
101
- calculated = testPosition(lastUsedPosition ?? position);
101
+ calculated = testPosition(lastUsedPosition ?? position, { width });
102
102
  root.removeChild(contentClone);
103
103
  const { styles } = calculated;
104
104
  const translateX = (styles.right !== null ? -styles.right : styles.left) + window.scrollX;
@@ -112,8 +112,8 @@ const applyPosition = (args) => {
112
112
  width: styles.width !== null ? `${styles.width}px` : (width ?? undefined),
113
113
  transform: `translate(${translateX}px, ${translateY}px)`,
114
114
  };
115
- content.style.cssText = "";
116
115
  Object.entries(resolvedStyles).forEach(([key, value]) => {
116
+ content.style.removeProperty(key);
117
117
  if (!value)
118
118
  return;
119
119
  content.style.setProperty(key, value);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reshaped/utilities",
3
3
  "description": "Vanilla JS utilities for implementing common UI patterns",
4
- "version": "3.10.0-canary.5",
4
+ "version": "3.10.0-canary.6",
5
5
  "license": "MIT",
6
6
  "homepage": "https://reshaped.so",
7
7
  "repository": {