Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/common/EditableInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class EditableInput extends (PureComponent || Component) {
this.props.value !== this.state.value &&
(prevProps.value !== this.props.value || prevState.value !== this.state.value)
) {
if (this.input === document.activeElement) {
if (this.input === this.getInputRootNode().activeElement) {
this.setState({ blurValue: String(this.props.value).toUpperCase() })
} else {
this.setState({ value: String(this.props.value).toUpperCase(), blurValue: !this.state.blurValue && String(this.props.value).toUpperCase() })
Expand Down Expand Up @@ -63,6 +63,10 @@ export class EditableInput extends (PureComponent || Component) {
return this.props.arrowOffset || DEFAULT_ARROW_OFFSET
}

getInputRootNode() {
return this.input.getRootNode ? this.input.getRootNode() : document;
}

handleKeyDown = (e) => {
// In case `e.target.value` is a percentage remove the `%` character
// and update accordingly with a percentage
Expand Down