diff --git a/web-console/src/bootstrap/react-table-custom-pagination.tsx b/web-console/src/bootstrap/react-table-custom-pagination.tsx index 92465fd7576..bcc900f130c 100644 --- a/web-console/src/bootstrap/react-table-custom-pagination.tsx +++ b/web-console/src/bootstrap/react-table-custom-pagination.tsx @@ -123,7 +123,7 @@ export class ReactTableCustomPagination extends React.PureComponent< value={tempPage || String(page + 1)} onBlur={this.applyTempPage} onKeyPress={e => { - if (e.which === 13 || e.keyCode === 13) { + if (e.key === 'Enter') { this.applyTempPage(e); } }} diff --git a/web-console/src/entry.ts b/web-console/src/entry.ts index b108db412a3..675d5730bce 100644 --- a/web-console/src/entry.ts +++ b/web-console/src/entry.ts @@ -108,7 +108,7 @@ ReactDOM.render( let mode: 'mouse' | 'tab' = 'mouse'; function handleTab(e: KeyboardEvent) { - if (e.keyCode !== 9) return; + if (e.key !== 'Tab') return; if (mode === 'tab') return; mode = 'tab'; document.body.classList.remove('mouse-mode'); diff --git a/web-console/src/views/query-view/query-output/column-rename-input/column-rename-input.tsx b/web-console/src/views/query-view/query-output/column-rename-input/column-rename-input.tsx index d8870d86827..4a6f5fae896 100644 --- a/web-console/src/views/query-view/query-output/column-rename-input/column-rename-input.tsx +++ b/web-console/src/views/query-view/query-output/column-rename-input/column-rename-input.tsx @@ -44,12 +44,12 @@ export const ColumnRenameInput = React.memo(function ColumnRenameInput( value={newName} onChange={(e: any) => setNewName(e.target.value)} onKeyDown={(e: React.KeyboardEvent) => { - switch (e.keyCode) { - case 13: // Enter + switch (e.key) { + case 'Enter': maybeDone(); break; - case 27: // Esc + case 'Escape': onDone(); break; }