Skip to content

Commit

Permalink
fix(ask-panel): prevent default behavior for Command/Ctrl+K shortcut
Browse files Browse the repository at this point in the history
- Enabled default prevention for Command+K (Mac) and Ctrl+K (Windows/Linux) keyboard shortcut
- Ensures proper dropdown navigation when using keyboard shortcuts
  • Loading branch information
crazygo committed Jan 26, 2025
1 parent f2890cf commit 9fb5dc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ask-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function AskPanel(props: AskPanelProps) {
function handleKeyDown(e: KeyboardEvent) {
// 检测 Command+K (Mac) 或 Ctrl+K (Windows/Linux)
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
// e.preventDefault();
e.preventDefault();
if (!isToolDropdownOpen && !isModelDropdownOpen && !isSystemPromptDropdownOpen) {
showToolDropdown();
} else if (isToolDropdownOpen) {
Expand Down

0 comments on commit 9fb5dc5

Please sign in to comment.