@basic-ui/core 0.0.48 → 0.0.50

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.
@@ -205,7 +205,7 @@ function wrapEvent(theirHandler, ourHandler) {
205
205
  return (event, ...otherArgs) => {
206
206
  const ret = theirHandler && theirHandler(event, ...otherArgs);
207
207
 
208
- if (!event.defaultPrevented) {
208
+ if (!event || !event.defaultPrevented) {
209
209
  return ourHandler(event, ...otherArgs);
210
210
  }
211
211
 
@@ -2188,14 +2188,14 @@ const MenuList = /*#__PURE__*/react.forwardRef(function MenuList(props, forwarde
2188
2188
  setMounted(true);
2189
2189
  }, [mounted, navigationItem, onNavigate, openWithArrowKeyRef, scope, defaultActiveItemValue]);
2190
2190
  const handleClickOutside = react.useCallback(e => {
2191
- if (!interactedOutside.current) {
2192
- // First interaction should be ignored, because
2193
- // this is what triggered the context menu to open
2194
- interactedOutside.current = true;
2195
- return;
2196
- }
2197
-
2198
2191
  if (isContextMenu.current) {
2192
+ if (!interactedOutside.current && e.pointerType === 'touch') {
2193
+ // First interaction should be ignored, because
2194
+ // this is what triggered the context menu to open
2195
+ interactedOutside.current = true;
2196
+ return;
2197
+ }
2198
+
2199
2199
  if (e.button === 0) {
2200
2200
  onChange(e, false);
2201
2201
  }