Skip to content

Commit

Permalink
server (webui): Fix Premature Submission During IME Conversion (#11971)
Browse files Browse the repository at this point in the history
* fix skip ime composing

* fix npm rebuild

* fix warn

---------

Co-authored-by: momonga <[email protected]>
Co-authored-by: Xuan Son Nguyen <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2025
1 parent c5d91a7 commit c392e50
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
Binary file modified examples/server/public/index.html.gz
Binary file not shown.
1 change: 1 addition & 0 deletions examples/server/webui/src/components/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export default function ChatScreen() {
value={inputMsg}
onChange={(e) => setInputMsg(e.target.value)}
onKeyDown={(e) => {
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
if (e.key === 'Enter' && e.shiftKey) return;
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion examples/server/webui/src/utils/llama-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const useVSCodeContext = (

window.addEventListener('message', handleMessage);
return () => window.removeEventListener('message', handleMessage);
}, []);
}, [inputRef, setInputMsg]);

// Add a keydown listener that sends the "escapePressed" message to the parent window
useEffect(() => {
Expand Down

0 comments on commit c392e50

Please sign in to comment.