Don't select a model editor row when you click the suggest box (#3307)

This commit is contained in:
Shati Patel
2024-02-06 14:01:21 +00:00
committed by GitHub
parent 7c233db4eb
commit b35d6cbb3a

View File

@@ -106,6 +106,10 @@ export type SuggestBoxProps<
) => ReactNode;
};
const stopClickPropagation = (e: React.MouseEvent) => {
e.stopPropagation();
};
export const SuggestBox = <
T extends Option<T>,
D extends Diagnostic = Diagnostic,
@@ -196,7 +200,9 @@ export const SuggestBox = <
}, [disabled]);
return (
<>
// Disabled because the div is used to stop click propagation, it's not a button
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div onClick={stopClickPropagation}>
{renderInputComponent(
getReferenceProps({
ref: refs.setReference,
@@ -270,6 +276,6 @@ export const SuggestBox = <
)}
</FloatingPortal>
)}
</>
</div>
);
};