mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-02 09:12:03 +00:00 
			
		
		
		
	server (webui): Fix Premature Submission During IME Conversion (#11971)
* fix skip ime composing * fix npm rebuild * fix warn --------- Co-authored-by: momonga <115213907+mmnga@users.noreply.github.com> Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							@@ -228,6 +228,7 @@ export default function ChatScreen() {
 | 
				
			|||||||
            value={inputMsg}
 | 
					            value={inputMsg}
 | 
				
			||||||
            onChange={(e) => setInputMsg(e.target.value)}
 | 
					            onChange={(e) => setInputMsg(e.target.value)}
 | 
				
			||||||
            onKeyDown={(e) => {
 | 
					            onKeyDown={(e) => {
 | 
				
			||||||
 | 
					              if (e.nativeEvent.isComposing || e.keyCode === 229) return;
 | 
				
			||||||
              if (e.key === 'Enter' && e.shiftKey) return;
 | 
					              if (e.key === 'Enter' && e.shiftKey) return;
 | 
				
			||||||
              if (e.key === 'Enter' && !e.shiftKey) {
 | 
					              if (e.key === 'Enter' && !e.shiftKey) {
 | 
				
			||||||
                e.preventDefault();
 | 
					                e.preventDefault();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@ export const useVSCodeContext = (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    window.addEventListener('message', handleMessage);
 | 
					    window.addEventListener('message', handleMessage);
 | 
				
			||||||
    return () => window.removeEventListener('message', handleMessage);
 | 
					    return () => window.removeEventListener('message', handleMessage);
 | 
				
			||||||
  }, []);
 | 
					  }, [inputRef, setInputMsg]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Add a keydown listener that sends the "escapePressed" message to the parent window
 | 
					  // Add a keydown listener that sends the "escapePressed" message to the parent window
 | 
				
			||||||
  useEffect(() => {
 | 
					  useEffect(() => {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user