@wistia/ui 0.8.26-beta.eca3d970.0a51bfe → 0.8.27

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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.8.26-beta.eca3d970.0a51bfe
3
+ * @license @wistia/ui v0.8.27
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -8500,6 +8500,11 @@ Checkbox.displayName = "Checkbox";
8500
8500
 
8501
8501
  // src/components/ClickRegion/ClickRegion.tsx
8502
8502
  var import_react30 = require("react");
8503
+ var isClickableElement = (element) => {
8504
+ if (!element) return false;
8505
+ const el = element;
8506
+ return el.closest("button") !== null || el.closest("a") !== null || el.closest("input") !== null || el.closest("select") !== null || el.closest("textarea") !== null || el.closest("label") !== null || el.closest("[data-wui-faux-input]") !== null;
8507
+ };
8503
8508
  var ClickRegion = ({ children, targetRef }) => {
8504
8509
  (0, import_react30.useEffect)(() => {
8505
8510
  if (targetRef.current && targetRef.current.tagName === "A") {
@@ -8512,7 +8517,10 @@ var ClickRegion = ({ children, targetRef }) => {
8512
8517
  const handleClick = (0, import_react30.useCallback)(
8513
8518
  (event) => {
8514
8519
  const node = targetRef.current;
8515
- if (event.target instanceof HTMLAnchorElement && !event.target.hasAttribute("data-click-region-target-link") || event.target instanceof HTMLButtonElement && !event.target.hasAttribute("data-click-region-target-button")) {
8520
+ if (event.target === node) {
8521
+ return;
8522
+ }
8523
+ if (isClickableElement(event.target) && event.target !== node) {
8516
8524
  event.stopPropagation();
8517
8525
  return;
8518
8526
  }