improve keyboard shortcuts handling

This commit is contained in:
Mo Tarbin
2026-08-10 00:19:57 -04:00
parent b7bdfa7885
commit af926b033e
3 changed files with 81 additions and 76 deletions

View File

@@ -1,15 +1,15 @@
import { useState, useEffect } from 'react'
import { useEffect, useState } from 'react'
export const useKeyboardShortcuts = ({
isMultiSelectMode,
selectedChores,
addTaskModalOpen,
searchTerm,
searchFilter,
filteredChores,
choreSections,
openChoreSections,
filteredChores,
handlers,
isMultiSelectMode,
openChoreSections,
searchFilter,
searchTerm,
selectedChores,
}) => {
const [showKeyboardShortcuts, setShowKeyboardShortcuts] = useState(false)
@@ -35,10 +35,6 @@ export const useKeyboardShortcuts = ({
event.preventDefault()
handlers.onNavigateToCreate()
return
} else if (isHoldingCmdOrCtrl && event.key === 'f') {
event.preventDefault()
handlers.onFocusSearch()
return
} else if (isHoldingCmdOrCtrl && event.key === 'x') {
event.preventDefault()
if (searchTerm?.length > 0) {