Skip to content

Commit f9ecb7c

Browse files
committed
Fixes an issue when text is not selectable
Fixes na issue when text is not selectable
1 parent 8f36623 commit f9ecb7c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@webscopeio/react-console",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "React component that emulates console behaviour",
55
"author": "jvorcak",
66
"license": "MIT",

src/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,13 @@ export default class ReactConsole extends React.Component<Props, State> {
154154
this.setState({
155155
input: e.target.value,
156156
})
157-
}
157+
};
158158

159159
focusConsole = () => {
160-
this.inputRef.focus()
160+
if(this.inputRef) {
161+
if(window.getSelection().type !== "Range") {
162+
this.inputRef.focus()
163+
}
164+
}
161165
}
162166
}

0 commit comments

Comments
 (0)