MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / handleEnter

Function handleEnter

packages/ui/src/views/chatmessage/ChatMessage.jsx:1235–1253  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1233 }
1234 // Prevent blank submissions and allow for multiline input
1235 const handleEnter = (e) => {
1236 // Check if IME composition is in progress
1237 const isIMEComposition = e.isComposing || e.keyCode === 229
1238 if (e.key === 'ArrowUp' && !isIMEComposition) {
1239 e.preventDefault()
1240 const previousInput = inputHistory.getPreviousInput(userInput)
1241 setUserInput(previousInput)
1242 } else if (e.key === 'ArrowDown' && !isIMEComposition) {
1243 e.preventDefault()
1244 const nextInput = inputHistory.getNextInput()
1245 setUserInput(nextInput)
1246 } else if (e.key === 'Enter' && userInput && !isIMEComposition) {
1247 if (!e.shiftKey && userInput) {
1248 handleSubmit(e)
1249 }
1250 } else if (e.key === 'Enter') {
1251 e.preventDefault()
1252 }
1253 }
1254
1255 const getLabel = (URL, source) => {
1256 if (URL && typeof URL === 'object') {

Callers

nothing calls this directly

Calls 3

getPreviousInputMethod · 0.80
getNextInputMethod · 0.80
handleSubmitFunction · 0.70

Tested by

no test coverage detected