diff --git a/app/javascript/packs/src/settings/components/account/InputEnabled.jsx b/app/javascript/packs/src/settings/components/account/InputEnabled.jsx index 2aa7425ce..bd08b3139 100644 --- a/app/javascript/packs/src/settings/components/account/InputEnabled.jsx +++ b/app/javascript/packs/src/settings/components/account/InputEnabled.jsx @@ -5,6 +5,7 @@ import { FormattedMessage } from "react-intl"; import { FormGroup, FormControl, ControlLabel, Button } from "react-bootstrap"; import { BORDER_LIGHT_COLOR } from "../../../../app/constants/colors"; +import { ENTER_KEY_CODE } from "../../../../app/constants/numeric"; const StyledInputEnabled = styled.div` border: 1px solid ${BORDER_LIGHT_COLOR}; @@ -36,6 +37,14 @@ class InputEnabled extends Component { this.handleChange = this.handleChange.bind(this); this.handleChange2 = this.handleChange2.bind(this); this.handleUpdate = this.handleUpdate.bind(this); + this.handleKeyPress = this.handleKeyPress.bind(this); + } + + handleKeyPress(event) { + if (event.charCode === ENTER_KEY_CODE) { + event.preventDefault(); + this.handleUpdate(); + } } handleChange(event) { @@ -89,7 +98,8 @@ class InputEnabled extends Component {

New password confirmation

); }