基础样式交互完成
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,9 +32,15 @@ export function ContractSearchHero({
|
||||
};
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user