-
Notifications
You must be signed in to change notification settings - Fork 832
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
feat/add keyboard control #431
Conversation
Awesome PR! Thanks! 🎉
Uhm, care to say which exactly? The far I see these changes in your very nice gifs, I am very satisfied. The only thing I possibly miss is the focus style:
|
Does this possibly also fix scttcper/ngx-emoji-mart#313? Also note you can (automatically) let issues close when a PR is merged by adding some "magic" text to your PR body. |
@rugk
|
@rugk I am not sure the best way to improve this. I just used the same mouse hover style it has currently. I'm kinda reluctant to add in new styles since I think designers in massive team could make better decision than me :). |
Yup, it will. I'll add magic to close this issue. As for #348, since not all of features you mentioned is implemented, should I still close the issue? |
I'm not sure whether this is a good idea, accessibility-wise. As that is the default accessibility feature. But I'm probably the wrong one to ask, whether this is good…
I'd say yes, as long as the maintainer(s) do not say anything else. |
Even if you are at the first of all rows? E.g. this should be possible IMHO (+ user story):
|
I'd say that since emoji grid is separated from the search bar, based on the a11y guideline, Up should not go back to search bar since it is essentially different region. Maybe we could have search bar always in focus and thus users could type in more characters if they need to.
One benefit I can think of is that users don't have to press up 5 times, say, to just get back to the search bar. Now I also realized that when a category is selected or a search is triggered, it should automatically select the first emoji, without user pressing down I'm referring to slack emoji picker. I really like the fact that search bar is always focused so that users could just type in anything even when they are browsing emojis. |
This looks great! Thanks a lot for implementing it. If I may, I would like to offer some feedback on the interface. I think having the search bar always in focus makes more sense to me since it’s unambiguous. Letters and backspace change the search field, arrows select a particular emoji, Enter selects the emoji. If the search bar is auto-focused when the interface is shown, that would allow selecting an emoji using the keyboard only with minimal keystrokes, which is ideal while writing a message. |
All great ideas. I'm going to implement
|
Does not this conflict with accessibility though? Don't screenreaders always read the thing that is focused? |
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.
LGTM (but I don't know React very much)
Could we consider merging this PR in? @EtienneLem ? |
switch (e.keyCode) { | ||
case 13: | ||
switch (e.key) { | ||
case 'Enter': |
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.
Just because I'm not sure: Currently (with tab focus switches) also space works for selecting emojis. This here only refers to Enter.
IMHO space should also continue to work… 🤔
I also don't know whether this is the right thing to add in this PR, but I have a use case, where I'd like more shortcuts to trigger something in the picker/with the selected emoji. In my case Ctrl+C should e.g. trigger a copy to clipboard. As all methods we can use to get the selected/chosen emoji currently are reactive (i.e. as an dev outside the lib you only get the emoji if something happens as as a result of a click or so) this is hard to implement. Or… of course… you just expose the current keypress handler. However, IMHO, that would be less flexible as an API, because you are then – yet again – limited to key presses only. Edit: Don't know whether that may also return if an emoji is only hovered hmm… maybe it can do both, possibly in two separate functions. 🤔 |
@rugk Sorry for the late reply. What you mentioned is a pretty cool idea. I think you could create a separate issue and PR on this. :) |
Okay, done: #444 |
638c0b6
to
51dd4a9
Compare
51dd4a9
to
b611b9b
Compare
603783e
to
85d13bd
Compare
4349086
to
48bed5c
Compare
81d109a
to
2afd85f
Compare
c78d650
to
fdedc10
Compare
Any plans for this to be merged soon? Seems great. |
Looking forward to this too, very much needed for full keyboard navigation 💯 |
If you are interested in adding keyboard support, feel free to check out this release in our repo: https://github.com/pingboard/emoji-mart/releases/tag/v3.0.1 |
Hey @EtienneLem any idea when you can merge that and release ? |
Please consider also including vi-style keyboard navigation (hjkl) in addition to the arrow keys. This would make navigation even more efficient while typing, not having to move one's hands from the home row at all. I don't believe this would conflict with anything. |
Any tentative date of merging and releasing this ? |
Sorry for the radio silence on this PR. There are some important changes that I’m not very sold on, I’m not sure why the layout had to be changed to |
@EtienneLem The main reason why I changed to |
I would really love to see this merged in and part of a newer version. I'm planning to use this for a Chrome extension I'm developing, but in my opinion it's really not that user friendly unless keyboard navigation is possible. |
I totally agree, @evang522, and I'm actually affected in the same way as you are affected. |
Thanks a lot for your contribution. v5.0.0 has been released and this doesn’t apply anymore. The new version has full keyboard control. |
Changes
closes scttcper/ngx-emoji-mart#313
Added keyboard control:
Category anchors:
Emoji:
Style:
Markup:
References: