2
0

🐛 (condition) Greater and Less should compare list length when possible

This commit is contained in:
Baptiste Arnaud
2023-04-20 14:54:56 +02:00
parent 4d1fe4c1de
commit c77b8e7548
4 changed files with 24 additions and 18 deletions

View File

@ -29,6 +29,11 @@ export const TextInput = (props: Props) => {
if (e.key === 'Enter') submit()
}
const submitIfCtrlEnter = (e: KeyboardEvent) => {
if (!props.block.options.isLong) return
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) submit()
}
onMount(() => {
if (!isMobile() && inputRef) inputRef.focus()
})
@ -46,6 +51,7 @@ export const TextInput = (props: Props) => {
<Textarea
ref={inputRef as HTMLTextAreaElement}
onInput={handleInput}
onKeyDown={submitIfCtrlEnter}
value={inputValue()}
placeholder={
props.block.options?.labels?.placeholder ?? 'Type your answer...'