✨ Simplify arrow function syntax and remove unnecessary whitespace across composable utilities
This commit is contained in:
@@ -9,7 +9,7 @@ import { onMounted, onUnmounted } from 'vue';
|
||||
* Register keyboard shortcuts
|
||||
* @param {Object} shortcuts - Map of key combinations to handlers
|
||||
* @returns {Object} Control functions
|
||||
*
|
||||
*
|
||||
* Example shortcuts object:
|
||||
* {
|
||||
* 'ctrl+f': () => focusSearch(),
|
||||
@@ -18,7 +18,7 @@ import { onMounted, onUnmounted } from 'vue';
|
||||
* }
|
||||
*/
|
||||
export function useKeyboardShortcuts(shortcuts = {}) {
|
||||
const handleKeyDown = (event) => {
|
||||
const handleKeyDown = event => {
|
||||
const key = event.key.toLowerCase();
|
||||
const ctrl = event.ctrlKey || event.metaKey; // Support both Ctrl and Cmd
|
||||
const shift = event.shiftKey;
|
||||
@@ -36,7 +36,7 @@ export function useKeyboardShortcuts(shortcuts = {}) {
|
||||
|
||||
// Try to find and execute handler
|
||||
const handler = shortcuts[combination] || shortcuts[simpleKey];
|
||||
|
||||
|
||||
if (handler) {
|
||||
event.preventDefault();
|
||||
handler(event);
|
||||
|
||||
Reference in New Issue
Block a user