@whitesev/pops 1.2.0 → 1.2.2

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.esm.js CHANGED
@@ -8962,11 +8962,13 @@ class PopsRightClickMenu {
8962
8962
  popsDOMUtils.on(globalThis, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8963
8963
  capture: true,
8964
8964
  });
8965
- const $shadowRoot = config.target.getRootNode();
8966
- if ($shadowRoot instanceof ShadowRoot) {
8967
- popsDOMUtils.on($shadowRoot, "click touchstart", void 0, PopsContextMenu.shadowRootCheckClickEvent, {
8968
- capture: true,
8969
- });
8965
+ if (config.target instanceof Node) {
8966
+ const $shadowRoot = config.target.getRootNode();
8967
+ if ($shadowRoot instanceof ShadowRoot) {
8968
+ popsDOMUtils.on($shadowRoot, "click touchstart", void 0, PopsContextMenu.shadowRootCheckClickEvent, {
8969
+ capture: true,
8970
+ });
8971
+ }
8970
8972
  }
8971
8973
  },
8972
8974
  /**
@@ -8976,11 +8978,13 @@ class PopsRightClickMenu {
8976
8978
  popsDOMUtils.off(globalThis, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8977
8979
  capture: true,
8978
8980
  });
8979
- const $shadowRoot = config.target.getRootNode();
8980
- if ($shadowRoot instanceof ShadowRoot) {
8981
- popsDOMUtils.off($shadowRoot, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8982
- capture: true,
8983
- });
8981
+ if (config.target instanceof Node) {
8982
+ const $shadowRoot = config.target.getRootNode();
8983
+ if ($shadowRoot instanceof ShadowRoot) {
8984
+ popsDOMUtils.off($shadowRoot, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8985
+ capture: true,
8986
+ });
8987
+ }
8984
8988
  }
8985
8989
  },
8986
8990
  /**