Removed unused keys disable

This commit is contained in:
Eugene 2023-07-21 19:19:59 +03:00
parent d80cb707fe
commit 3f896f5603
1 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,7 @@ export class Scroller {
this.root.renderSheet() this.root.renderSheet()
} }
private handleDoubleClick = (event: MouseEvent) => { private handleDoubleClick = (event: MouseEvent) => {
event.preventDefault(); event.preventDefault();
const position = this.root.getCellByCoords(event.offsetX, event.offsetY) const position = this.root.getCellByCoords(event.offsetX, event.offsetY)
@ -70,10 +70,10 @@ export class Scroller {
} }
private handleKeydown = (event: KeyboardEvent) => { private handleKeydown = (event: KeyboardEvent) => {
event.preventDefault()
console.log(event.key) console.log(event.key)
//* Navigation //* Navigation
if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) { if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
event.preventDefault()
this.root.selection.selectedRange = null this.root.selection.selectedRange = null
switch (event.key) { switch (event.key) {
case 'ArrowLeft': { case 'ArrowLeft': {
@ -109,11 +109,13 @@ export class Scroller {
} }
if (event.key === 'F2') { if (event.key === 'F2') {
event.preventDefault()
if (!this.root.selection.selectedCell) return; if (!this.root.selection.selectedCell) return;
this.root.showEditor(this.root.selection.selectedCell) this.root.showEditor(this.root.selection.selectedCell)
} }
if (event.key === 'Delete') { if (event.key === 'Delete') {
event.preventDefault()
this.root.deleteSelectedCellsValues() this.root.deleteSelectedCellsValues()
this.root.renderSheet() this.root.renderSheet()
} }