Merge pull request #41 from zonghaoyuan/fix/ime-enter-key

fix(web): prevent Enter key from firing during IME composition
This commit is contained in:
Zonghao Yuan
2026-06-06 22:57:04 +08:00
committed by GitHub
+10 -1
View File
@@ -1610,7 +1610,11 @@ export default function HomePage() {
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
if (
e.key === "Enter" &&
!e.shiftKey &&
!e.nativeEvent.isComposing
) {
e.preventDefault();
start();
}
@@ -1638,6 +1642,11 @@ export default function HomePage() {
<i className="fa-solid fa-arrow-right text-xs" />
</button>
</div>
{prompt && (
<p className="mt-2 text-right text-xs text-clay-400">
Enter · Shift+Enter
</p>
)}
</form>
{/* 类别选择器(居中) */}