Skip to content

Commit

Permalink
Removing move cursor to end feature from TextInputFocusable
Browse files Browse the repository at this point in the history
  • Loading branch information
tugbadogan committed Mar 24, 2021
1 parent 7bb32d8 commit 5f1004e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
20 changes: 0 additions & 20 deletions src/components/TextInputFocusable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ const propTypes = {

// Whether or not this TextInput is disabled.
isDisabled: PropTypes.bool,

// Whether or not force move cursor to end all the time
forceMoveCursorToEnd: PropTypes.bool,
};

const defaultProps = {
Expand All @@ -52,7 +49,6 @@ const defaultProps = {
onDragLeave: () => {},
onDrop: () => {},
isDisabled: false,
forceMoveCursorToEnd: false,
};

const IMAGE_EXTENSIONS = {
Expand Down Expand Up @@ -114,9 +110,6 @@ class TextInputFocusable extends React.Component {
}
if (prevProps.defaultValue !== this.props.defaultValue) {
this.updateNumberOfLines();
if (this.props.forceMoveCursorToEnd) {
this.moveCursorToEnd();
}
}
}

Expand Down Expand Up @@ -205,19 +198,6 @@ class TextInputFocusable extends React.Component {
});
}

/**
* Move cursor to end by setting start and end
* to length of the input value.
*/
moveCursorToEnd() {
this.setState({
selection: {
start: this.props.defaultValue.length,
end: this.props.defaultValue.length,
},
});
}

focusInput() {
this.textInput.focus();
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class IOUAmountPage extends React.Component {
ref={el => this.textInput = el}
defaultValue={this.props.amount}
textAlign="left"
forceMoveCursorToEnd
/>
<Text
style={[styles.iouAmountText, styles.invisible, {left: 100000}]}
Expand Down

0 comments on commit 5f1004e

Please sign in to comment.