Morning,
I’m building a ChatGPT fine-tuned model. In the text input, if the user Shift + Enter, it should recognize as New line and let the user paste in more text.
I’ve tried to use both TextBox and TextArea, but with TextBox, the Shift + Enter also recognize as pressed_enter action, and the TextArea doesn’t have a pressed_enter action.
I’m wondering if there is any work around that let the user enter multi line of text and still have the send action bind to the enter key?
Many thanks,
1 Like
You can use the keyboard events from javascript and check the status of the shift.
The augment module from Anvil Extras can help you with it.
2 Likes
Thank you stefano,
Unfortunately I’m clueless in JS but that was a good suggestion. I’ll take a look into it.
Oh and one more slight problem. I prefer the look of TextBox, but it doesn’t support multi line text I think. I tried to pass a \n into a string but it didn’t show up as multi line.
To have multiline support, you should use the TextArea instead. If you use the augment module, I believe you have to use minimal JS.