ChatGPT-like input #3704
Replies: 2 comments 4 replies
-
ui.input(placeholder="Search").props(
"""
rounded
autogrow
autofocus
outlined
"""
).on('keypress.enter',lambda e:None if e.args['shiftKey'] else e.sender.set_value('') ,args=['shiftKey']) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dominikpeter
-
Awesome! Thanks a lot! |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I am looking for a way to mimic the behaviour of ChatGPT Input - or most other chatbots. This behaves as follows: When typing text and pressing Enter, the "search" is fired. When hitting Shift+Enter or pasting line delimited text, the input automatically becomes multiline.
I can easily enable autogrow with quasar props. However, this now also adds a new line with a normal
keypress.enter
.I also found this on Stackoverflow but could not get it to work.
Any idea how I can change the props to enable this behaviour?
Beta Was this translation helpful? Give feedback.
All reactions