-
Notifications
You must be signed in to change notification settings - Fork 297
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
[DDW-173] Submit forms on Enter key #981
[DDW-173] Submit forms on Enter key #981
Conversation
@nikolaglumac probably not the best way to handle the "submit on enter" in the Send dialog. |
@daniloprates there are some flow/lint issues detected by the CI check. |
@nikolaglumac it makes sense, although, from a user perspective, it feels right to have it, when submitting the previous form with Enter. Waiting for @DominikGuzei's opinion. |
@daniloprates if that is what you want to have then we must have some kind of an active button state outline/glow on the active element - in this case the blue submit button. |
Yeah i agree with both of you - UX wise it would be nice to be able to submit all dialogs too with ENTER but then the submit button needs a glow / active state |
Cool, I'll give it a try |
The question is where to put an end to this feature - e.g. should the user also be able to use TAB key to switch between the fields and also change the focus of the buttons? |
@nikolaglumac yes, I was thinking of changing my approach to a simple focus in the confirm button (along with a proper styling). |
@daniloprates OK let's see how it will look and feel ;) |
I like the solution. It feels good to use Enter when you've just used in the previous form. The code is also much cleaner: Looking forward to hear from you @nikolaglumac @DominikGuzei |
@a-rukin what do you think about the active button state? Do you like what @daniloprates is proposing or you have some better idea? |
Is this dotted line shown only when hovered by tab? |
@a-rukin nope, only in the |
@daniloprates how this focus state can be achieved? |
Also what happens on focus with grey button? |
@a-rukin this is the state where you can press Space or Enter to click the button. It can be achieve via javascript ( I've chosen the light themes color based in the default Chrome outline color: #3b99fc. For the dark theme I've just chosen a lighter version of its background color. It's just a suggestion, feel free to choose more appropriate colors. Bellow is how it looks in the dark theme: |
So if we press "Tab" button it should be the same, right? |
How to get the Daedalus wallet address plz
|
@daniloprates i tested it and would like to have TAB either do nothing (keep the focus state on the submit button) or just switch between submit and cancel (within the dialog). At the moment TAB removes the focus from submit and gives it to some other element (not obvious where) and only if you press TAB twice then you get focus back on the submit button (not so nice UX) |
Looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, love it! 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works great! 🎉
Great work @daniloprates! We can merge this PR as soon as CI is done... |
Why not just bind to the "submit" event of the form instead of listening for a keypress or mouse click individually? |
@ShimShamSam all forms had been done this way, so it was easier and safer to implement the "Enter" this way. |
This PR enables submitting forms on Enter key press.
Todo:
:focus
state style to all buttonsonMouseUp
toonClick
on buttons, so it can be triggered by pressing Enter:focus
state style and colors for the 3 Daedalus themes (@a-rukin)Screenshots
Review Checklist:
Basics
npm run test
)npm run dev
)npm run package
/ CI builds)npm run flow:test
)npm run lint
)npm run manage:translations
produces no changes)npm run storybook
)package-lock.json
andyarn.lock
files are updatedCode Quality
Testing
After Review:
done
on the Youtrack board