Skip to content

Commit

Permalink
Fix disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Mar 3, 2025
1 parent b40ab95 commit c1d5437
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/react/src/select/root/useSelectRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ import { useOpenChangeComplete } from '../../utils/useOpenChangeComplete';

const EMPTY_ARRAY: never[] = [];

function isDisabled(element: HTMLElement | null) {
return (
element == null || element.hasAttribute('disabled') || element.hasAttribute('data-disabled')
);
}

export function useSelectRoot<T>(params: useSelectRoot.Parameters<T>): useSelectRoot.ReturnValue {
const {
id: idProp,
Expand Down Expand Up @@ -198,10 +192,8 @@ export function useSelectRoot<T>(params: useSelectRoot.Parameters<T>): useSelect
},
});

const triggerDisabled = isDisabled(triggerElement);

const click = useClick(floatingRootContext, {
enabled: !readOnly && !disabled && !triggerDisabled,
enabled: !readOnly && !disabled,
event: 'mousedown',
});

Expand Down

0 comments on commit c1d5437

Please sign in to comment.