Skip to content

Commit

Permalink
Revert "Partial changes for issue mui#656"
Browse files Browse the repository at this point in the history
This reverts commit dd6b148.
  • Loading branch information
onehanddev committed Oct 13, 2024
1 parent dd6b148 commit cc20541
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/data/api/menu-trigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"props": {
"className": { "type": { "name": "union", "description": "func<br>&#124;&nbsp;string" } },
"disabled": { "type": { "name": "bool" }, "default": "false" },
"focusableWhenDisabled": { "type": { "name": "bool" }, "default": "false" },
"label": { "type": { "name": "string" } },
"render": { "type": { "name": "union", "description": "element<br>&#124;&nbsp;func" } }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"description": "Class names applied to the element or a function that returns them based on the component&#39;s state."
},
"disabled": { "description": "If <code>true</code>, the component is disabled." },
"focusableWhenDisabled": {
"description": "If <code>true</code>, allows a disabled button to receive focus."
},
"label": { "description": "Label of the button" },
"render": { "description": "A function to customize rendering of the component." }
},
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Checkbox/Root/CheckboxRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ const CheckboxRoot = React.forwardRef(function CheckboxRoot(
extraProps: {
...otherProps,
...otherGroupProps,
disabled
},
});

Expand Down
10 changes: 10 additions & 0 deletions packages/mui-base/src/Menu/Trigger/MenuTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ namespace MenuTrigger {
* @default false
*/
disabled?: boolean;
/**
* If `true`, allows a disabled button to receive focus.
* @default false
*/
focusableWhenDisabled?: boolean;
/**
* Label of the button
*/
Expand Down Expand Up @@ -98,6 +103,11 @@ MenuTrigger.propTypes /* remove-proptypes */ = {
* @default false
*/
disabled: PropTypes.bool,
/**
* If `true`, allows a disabled button to receive focus.
* @default false
*/
focusableWhenDisabled: PropTypes.bool,
/**
* Label of the button
*/
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Menu/Trigger/useMenuTrigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function useMenuTrigger(parameters: useMenuTrigger.Parameters): useMenuTr

const { getButtonProps, buttonRef } = useButton({
disabled,
focusableWhenDisabled: false,
buttonRef: mergedRef,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Switch/Root/SwitchRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const SwitchRoot = React.forwardRef(function SwitchRoot(
className,
propGetter: getButtonProps,
ownerState,
extraProps: {...other, disabled},
extraProps: other,
customStyleHookMapping: styleHookMapping,
ref: forwardedRef,
});
Expand Down

0 comments on commit cc20541

Please sign in to comment.