mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 13:04:17 +03:00
soto: ignore backspace at cursor position 0
If you entered the web dojo and hit Backspace immediately, it would still process it as a valid key but pass the whole key forward. This adds a conditional to ignore the key in those cases.
This commit is contained in:
parent
fed93b1fe5
commit
c1a4aeb60e
@ -39,6 +39,8 @@ export class Input extends Component {
|
|||||||
else if ((e.key === "Backspace") && (this.props.cursor > 0)) {
|
else if ((e.key === "Backspace") && (this.props.cursor > 0)) {
|
||||||
store.doEdit({ del: this.props.cursor - 1});
|
store.doEdit({ del: this.props.cursor - 1});
|
||||||
return store.setState({ cursor: this.props.cursor - 1});
|
return store.setState({ cursor: this.props.cursor - 1});
|
||||||
|
} else if (e.key === "Backspace") {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (e.key.startsWith("Arrow")) {
|
else if (e.key.startsWith("Arrow")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user