基础样式交互完成

This commit is contained in:
2025-05-29 18:29:46 +08:00
parent b32e055c7f
commit 01cea56a6a
4 changed files with 20 additions and 8 deletions
@@ -32,9 +32,15 @@ export function CompactSearchBox({
};
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
e.preventDefault();
handleSearch();
if (e.key === 'Enter') {
if (e.shiftKey) {
// Shift+回车:允许换行,不做任何处理
return;
} else {
// 单独回车:触发搜索
e.preventDefault();
handleSearch();
}
}
};