(e)
| 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') { |
nothing calls this directly
no test coverage detected