Skip to content

Commit

Permalink
fix: Ensure keepMounted prop prevents hidden attribute for inline ele…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
onehanddev committed Jan 13, 2025
1 parent 4d8f6a7 commit c09a5d9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const CheckboxIndicator = React.forwardRef(function CheckboxIndicator(
className,
customStyleHookMapping,
extraProps: {
hidden: !mounted,
hidden: !keepMounted && !mounted,
...otherProps,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const MenuCheckboxItemIndicator = React.forwardRef(function MenuCheckboxItemIndi
(externalProps = {}) =>
mergeReactProps(externalProps, {
'aria-hidden': true,
hidden: !mounted,
hidden: !keepMounted && !mounted,
}),
[mounted],
[keepMounted, mounted],
);

useAfterExitAnimation({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const MenuRadioItemIndicator = React.forwardRef(function MenuRadioItemIndicator(
(externalProps = {}) =>
mergeReactProps(externalProps, {
'aria-hidden': true,
hidden: !mounted,
hidden: !keepMounted && !mounted,
}),
[mounted],
[keepMounted, mounted],
);

useAfterExitAnimation({
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/radio/indicator/RadioIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const RadioIndicator = React.forwardRef(function RadioIndicator(
className,
state,
extraProps: {
hidden: !mounted,
hidden: !keepMounted && !mounted,
...otherProps,
},
customStyleHookMapping,
Expand Down

0 comments on commit c09a5d9

Please sign in to comment.