ai chat selection fix (#639)

This commit is contained in:
Cole Lashley 2024-05-06 20:00:46 -07:00 committed by sawka
parent 2772c76728
commit 1307a77b56

View File

@ -47,7 +47,10 @@ class CodeBlockMarkdown extends React.Component<
let clickHandler: (e: React.MouseEvent<HTMLElement>, blockIndex: number) => void;
let inputModel = GlobalModel.inputModel;
clickHandler = (e: React.MouseEvent<HTMLElement>, blockIndex: number) => {
inputModel.setCodeSelectSelectedCodeBlock(blockIndex);
const sel = window.getSelection();
if (sel?.toString().length == 0) {
inputModel.setCodeSelectSelectedCodeBlock(blockIndex);
}
};
let selected = this.blockIndex == this.props.codeSelectSelectedIndex;
return (