@strapi/ui-primitives 2.0.0-beta.6 → 2.0.0-rc.11

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.js CHANGED
@@ -338,10 +338,18 @@ const ComboboxTrigger = React__namespace.forwardRef((props, forwardedRef) => {
338
338
  ref: forwardedRef,
339
339
  "data-disabled": context.disabled ? "" : void 0,
340
340
  ...triggerProps,
341
- onClick: primitive.composeEventHandlers(triggerProps.onClick, () => {
341
+ onClick: primitive.composeEventHandlers(triggerProps.onClick, (event) => {
342
+ if (context.disabled) {
343
+ event.preventDefault();
344
+ return;
345
+ }
342
346
  context.trigger?.focus();
343
347
  }),
344
348
  onPointerDown: primitive.composeEventHandlers(triggerProps.onPointerDown, (event) => {
349
+ if (context.disabled) {
350
+ event.preventDefault();
351
+ return;
352
+ }
345
353
  const target = event.target;
346
354
  if (target.hasPointerCapture(event.pointerId)) {
347
355
  target.releasePointerCapture(event.pointerId);
@@ -877,11 +885,6 @@ const ComboboxNoValueFound = React__namespace.forwardRef((props, ref) => {
877
885
  unsub();
878
886
  };
879
887
  }, [subscribe]);
880
- if (items.length === 0)
881
- return null;
882
- if (autocomplete.type === "none") {
883
- return null;
884
- }
885
888
  if (autocomplete.type === "list" && autocomplete.filter === "startsWith" && items.some((item) => startsWith(item.textValue, textValue))) {
886
889
  return null;
887
890
  }