mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-04 14:10:27 +08:00
adds numeric.js to constants
This commit is contained in:
parent
790ae9d685
commit
b90348eabf
2 changed files with 3 additions and 1 deletions
1
app/javascript/packs/app/constants/numeric.js
Normal file
1
app/javascript/packs/app/constants/numeric.js
Normal file
|
@ -0,0 +1 @@
|
|||
export const ENTER_KEY_CODE = 13;
|
|
@ -8,6 +8,7 @@ import {
|
|||
} from "react-bootstrap";
|
||||
import styled from "styled-components";
|
||||
import { SEARCH_PATH } from "../../../app/routes";
|
||||
import { ENTER_KEY_CODE } from "../../../app/constants/numeric";
|
||||
|
||||
const StyledFormGroup = styled(FormGroup)`
|
||||
margin-bottom: 0px;
|
||||
|
@ -41,7 +42,7 @@ class SearchDropdown extends Component {
|
|||
}
|
||||
|
||||
handleKeyPress(ev) {
|
||||
if (ev.charCode === 13) {
|
||||
if (ev.charCode === ENTER_KEY_CODE) {
|
||||
this.submitSearch();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue