Skip to content

Commit 8b8a7a2

Browse files
authored
fix: Allow to prevent shortcuts processing in onKeyDown by returning false (#87)
Allow to prevent shortcuts processing in onKeyDown by returning false
1 parent 2a6ad14 commit 8b8a7a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ export default React.forwardRef<HTMLTextAreaElement, TextareaCodeEditorProps>((p
8181
{...other}
8282
placeholder={placeholder}
8383
onKeyDown={(evn) => {
84-
shortcuts(evn);
85-
other.onKeyDown && other.onKeyDown(evn);
84+
if (!other.onKeyDown || other.onKeyDown(evn)!==false) {
85+
shortcuts(evn);
86+
}
8687
}}
8788
style={{
8889
...styles.editor,

0 commit comments

Comments
 (0)