Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 900e49d

Browse files
author
Shammamah Hossain
committed
Allow for submit on enter.
1 parent 0447946 commit 900e49d

File tree

1 file changed

+2
-0
lines changed
  • src/dash-table/components/PageNavigation

1 file changed

+2
-0
lines changed

src/dash-table/components/PageNavigation/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import { IPageNavigationProps } from 'dash-table/components/PageNavigation/props';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4+
import { KEY_CODES } from 'dash-table/utils/unicode';
45

56
export default class PageNavigation extends Component<IPageNavigationProps> {
67

@@ -47,6 +48,7 @@ export default class PageNavigation extends Component<IPageNavigationProps> {
4748
type='text'
4849
className='current-page'
4950
onBlur={event => { this.goToPage(event.target.value); event.target.value = ''; }}
51+
onKeyDown={event => { if (event.keyCode === KEY_CODES.ENTER) { event.currentTarget.blur(); } }}
5052
placeholder={(page_current + 1).toString()}
5153
defaultValue=''
5254
>

0 commit comments

Comments
 (0)