mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 17:58:43 -05:00
fix: hide listbox focus border when popover (#1846)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ function ListBoxInline({ options, layout }) {
|
||||
<ListBoxFocusBorder
|
||||
width={containerRect?.width}
|
||||
height={containerRect?.height}
|
||||
isModalMode={isModalMode()}
|
||||
disabled={isModalMode() || isPopover}
|
||||
childNode={listboxChildNode}
|
||||
containerNode={containerNode}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user