fix: hide listbox focus border when popover (#1846)

This commit is contained in:
Daniel Sjöstrand
2025-11-25 09:00:07 +01:00
committed by GitHub
parent 4ec37c185e
commit f36ff6a300
2 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ const StyledBorder = styled('div')(({ theme, width, height }) => ({
boxShadow: `inset 0 0 0 2px ${theme.palette.custom.focusBorder}`,
}));
export default function ListBoxFocusBorder({ width, height, isModalMode, childNode, containerNode }) {
export default function ListBoxFocusBorder({ width, height, disabled, childNode, containerNode }) {
const [isOnlyContainerFocused, setIsOnlyContainerFocused] = useState(false);
const checkFocus = useCallback(() => {
@@ -34,7 +34,7 @@ export default function ListBoxFocusBorder({ width, height, isModalMode, childNo
};
}, [checkFocus, containerNode]);
const show = !isModalMode && isOnlyContainerFocused;
const show = !disabled && isOnlyContainerFocused;
if (!show) {
return null;
}

View File

@@ -281,7 +281,7 @@ function ListBoxInline({ options, layout }) {
<ListBoxFocusBorder
width={containerRect?.width}
height={containerRect?.height}
isModalMode={isModalMode()}
disabled={isModalMode() || isPopover}
childNode={listboxChildNode}
containerNode={containerNode}
/>