Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit c7166e7

Browse files
authored
Merge pull request #78 from onebar/code-block-focus-out
force editor selection only if handling click when language select is…
2 parents 74c4072 + 71b4e10 commit c7166e7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/Code/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,18 @@ class CodeBlock extends PureComponent {
7070
const { setReadOnly } = this.props.blockProps;
7171
event.stopPropagation();
7272
setReadOnly(true);
73+
this.setState({
74+
isOpen: true,
75+
});
7376
};
7477

7578
onClickOutside = () => {
79+
if (!this.state.isOpen) {
80+
return;
81+
}
82+
this.setState({
83+
isOpen: false,
84+
});
7685
const {
7786
getEditorState,
7887
setReadOnly,

0 commit comments

Comments
 (0)