Skip to content

Commit b35d6cb

Browse files
authored
Don't select a model editor row when you click the suggest box (#3307)
1 parent 7c233db commit b35d6cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

extensions/ql-vscode/src/view/common/SuggestBox/SuggestBox.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ export type SuggestBoxProps<
106106
) => ReactNode;
107107
};
108108

109+
const stopClickPropagation = (e: React.MouseEvent) => {
110+
e.stopPropagation();
111+
};
112+
109113
export const SuggestBox = <
110114
T extends Option<T>,
111115
D extends Diagnostic = Diagnostic,
@@ -196,7 +200,9 @@ export const SuggestBox = <
196200
}, [disabled]);
197201

198202
return (
199-
<>
203+
// Disabled because the div is used to stop click propagation, it's not a button
204+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
205+
<div onClick={stopClickPropagation}>
200206
{renderInputComponent(
201207
getReferenceProps({
202208
ref: refs.setReference,
@@ -270,6 +276,6 @@ export const SuggestBox = <
270276
)}
271277
</FloatingPortal>
272278
)}
273-
</>
279+
</div>
274280
);
275281
};

0 commit comments

Comments
 (0)