-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Enter key press in textboxes #348
Comments
I am fine with adding |
If the goal is to press the enter key to submit the form, then we should probably do this by default. Rule can be: if the enter key is pressed when the focus is on a child of a form_card and there is at least one button with The behavior should probably mimic html's |
@lo5 I am not sure this is possible right now, because |
Correct. And this is what happens today when you click on a button, so there's no change in current behavior after we introduce the enter-key handling. |
Yes, there is no change in behavior, but the behavior is still incorrect IMO. If it is desired though, what is the reason for:
There is no point in checking the actual form if it submits everything nonetheless. What about the usecase where you have just a single textbox (no buttons). You should be able to submit it with enter as well I think. |
The behavior of submitting everything on the page is by design. Maybe you're equating form cards to HTML forms?A form card is simply a stack of components, and has nothing to do with HTML forms. Consider that events can be raised from non-form-cards (e.g. context menus on cards, plot events, etc.)
Consider that the enter key (or any key press/up/down event) might need alternate handling for other kinds of cards that are not form cards.
Then there should be no submission, because at that point it's not apparent which command was invoked (there are no buttons on the page).
Submitting page state is a function of the page, not a textbox. Consider that if |
Yes, that's my point. Imagine you type something within app, do not save / submit it just yet. In the meantime, some dialog / notification etc. pops up, you submit an action and accidentally submit all the data you previously filled. Not something I would expect. I am aware of the current submission handling, just sayin I don't consider it correct and we should come up with an idea of scoping it (or something similar).
Don't understand this one. Do we have any card-dependent submission handling? Every component just sets args and optionally calls sync afaik. Not sure what special handling you mean.
But why? Isn't the main purpose of
Don't understand this. How is this prop different from any other textbox prop? You still have to specify your props per component instance. |
The usage patterns are different: For example, if you enabled the former behavior on a login dialog, it would send username/password to the app as you were typing in either username or password.
Same explanation as above. For example, submitting a username/password combo is not an attribute of either the username textbox or the password textbox. |
I think I can highlight some information here to help with conversation. The rule:
Is correct, because the button carries This
Consider having
As stated above, this is by design. Consider two I hope I didn't mess something up. I think, the fact that |
Thanks for joining the discussion @geomodular!
Makes perfect sense, I was wrong on this one. The design is correct then. Thanks for discussion and sorry for wasting your time guys. |
Hi,
Then I could do
That would be great. |
It seems to me that this could be reasonably solved with an event, where: |
This feature is really needed. Would be great if this is implemented and usable. In the moment, I don't see any action when "Enter" is pressed in a textbox with primary button in the same card. |
I have found on apps with a text box and button, as a user, I keep hitting
enter
when I'm done typing. I know text boxes have the option for a time trigger, but this might be more intuitive. Thoughts?The text was updated successfully, but these errors were encountered: