@strands.gg/accui 2.11.29 → 2.11.31

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/dist/index.es.js CHANGED
@@ -2158,6 +2158,9 @@ function useFloatingPosition(options) {
2158
2158
  const handleScroll = () => {
2159
2159
  updatePosition();
2160
2160
  if (clickOutside?.enabled && clickOutside.handler && trigger.value) {
2161
+ if (typeof trigger.value.getBoundingClientRect !== "function") {
2162
+ return;
2163
+ }
2161
2164
  const triggerRect = trigger.value.getBoundingClientRect();
2162
2165
  const viewportHeight = window.innerHeight;
2163
2166
  const viewportWidth = window.innerWidth;
@@ -2171,6 +2174,9 @@ function useFloatingPosition(options) {
2171
2174
  if (!clickOutside?.enabled || !clickOutside.handler) return;
2172
2175
  const target = event.target;
2173
2176
  if (!target || !trigger.value || !floating.value) return;
2177
+ if (typeof trigger.value.contains !== "function" || typeof floating.value.contains !== "function") {
2178
+ return;
2179
+ }
2174
2180
  const isClickInsideTrigger = trigger.value.contains(target);
2175
2181
  const isClickInsideFloating = floating.value.contains(target);
2176
2182
  if (!isClickInsideTrigger && !isClickInsideFloating) {
@@ -2186,10 +2192,10 @@ function useFloatingPosition(options) {
2186
2192
  updatePosition();
2187
2193
  });
2188
2194
  nextTick(() => {
2189
- if (trigger.value && resizeObserver) {
2195
+ if (trigger.value && resizeObserver && typeof trigger.value.getBoundingClientRect === "function") {
2190
2196
  resizeObserver.observe(trigger.value);
2191
2197
  }
2192
- if (floating.value && resizeObserver) {
2198
+ if (floating.value && resizeObserver && typeof floating.value.getBoundingClientRect === "function") {
2193
2199
  resizeObserver.observe(floating.value);
2194
2200
  }
2195
2201
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strands.gg/accui",
3
- "version": "2.11.29",
3
+ "version": "2.11.31",
4
4
  "description": "Strands Authentication UI Components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",