-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add option to "unselect" emoji #253
Comments
@mejo- I am not sure how this would work, how and where would this "unselect" option be displayed in the picker? Probably, the picker could keep track of the selected emoji and when you open it, display it and allow to "unselect" it. Still sure how this would look in the UI, but also it does not play well with some scenarios where the picker can be used: I used it to add emojis to the input field, similar to what we can see in Slack - we open the picker and click on some emojis that are populated into the text field, then emojis can be deleted with backspace if needed (but this is out of the picker responsibility). Questions:
Options to consider:
The last option, to use custom search or preview pane might work in your case. You can find an example in demo app. |
Dear @serebrov, thanks for your feedback. first, I completely agree that this should be an optional feature, to be enabled with a property and off per default.
That would mean the selected emoji would need to get passed by the code that uses the picker. It certainly would be an option.
I would a button that allows to "unselect" the emoji. A quick and dirty sketch (see the cancel button next to the search field):
I'd imagine an optional property like
That would be inconvenient - everytime we have the selected emoji as a button to pick another emoji we would need an extra button to allow unselecting it. That's the very reason why I came up with this feature request 😉
I agree that this would be hard to discover for users.
That indeed would work, thanks for the hint. But I still think that this feature would be interesting to other users of emoji-mart-vue as well. If you're open to the feature in general, I could imagine to further look into it and come up with a proper proposal (with help of our design team) and prepare a pull request. |
@mejo- I am hesitating because the "unselect" action has nothing to do with the picker itself: it assumes that there is a selected emoji somewhere, that is not a part of this component. This way, for this feature to be useful to other users, they have to have some specific situation in the UI, similar to what you have. I am not against the option and PR is welcome, but we would need to also explain in the documentation how this feature is supposed to be used, as I still do not clearly understand it. Could you also share more details about your UI, maybe a screenshot? How the "selected" emoji looks and what purpose that "selected" emoji serves? Practically, it looks like the approach with search template should work, something like this:
|
Hey @serebrov, sorry for not getting back to you earlier. I forgot a bit to answer here 🙈 So maybe with the following screenshots you get a better understanding: the application (Nextcloud Collectives) provides knowledge database features and each page can get an emoji assigned for better visibility: As you can see, the emoji picker allows to pick an emoji for pages. And we'd need a way to allow "unselecting" the selected emoji, if people want to remove the chosen emoji from a page instead of selecting a different one. |
@mejo- Have you solved this problem yet? I see your point now, but I am still not sure about the UI. One option would be to handle this outside the picker and have some "unselect" button near the document emoji (maybe as a little cross to "delete" it). It is not too hard to add this to the picker and I have a prototype in #268, but I did not find a good way to represent the selected emoji in the UI. I think the "delete" button after the search bar that we've discussed would not be the best choice as it is hard for the user to understand the purpose of that button. I have two ideas currently:
Here is a recording of the prototype: Screen.Recording.2023-05-06.at.21.13.27.mov |
Also prototyped the external delete button: for me, this option looks best (simple, clear for the user): Screen.Recording.2023-05-06.at.21.32.09.mov |
@serebrov how about combining 2 of your ideas:
and
So a delete button overlaid over the emoji displayed on the top inside the picker. This solves/avoids issues:
Of course this could also be done using the bottom bar, but I agree with you it might be a bit far. |
First, thanks a lot @serebrov for picking up this issue ❤️ Also, thanks @jancborchardt, I think I like your approach. What do you think about it @serebrov? |
@mejo- @jancborchardt It makes sense, I updated the prototype to move the "delete" button into the component too here is how it works: Screen.Recording.2023-06-04.at.13.17.54.movIn the current version, clicking the selected emoji for the second time also "unselects" and I am not sure if it is good to do that. Maybe it is better to only unselect when the user explicitly clicks the "remove" button? What do you think? |
@serebrov super nice! :) The unselection by clicking on the emoji itself probably is necessary to keep the click/tap target big enough. |
@jancborchardt @mejo- I worked more on the prototype and, when it was basically ready to be merged, I realized that the "selected" emoji logic heavily relies on the external state:
It works, but it feels wrong in the Picker code - I realized that when working on tests. Thinking about the solution, I found a much simpler version: add a Here is the code example. Functionally it works the same as the prototype above: Screen.Recording.2023-06-10.at.22.24.22.movLet me know if this version works for you. The extra bonus here is that the UI for the selected area can be controlled externally too (I am not sure if my "design" for the "x" icon is good enough for use beyond the demo). |
This indeed looks great! I will explore if we can make use of it for our use case. |
In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment)
In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment)
In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment)
In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment) Signed-off-by: Max <max@nextcloud.com>
In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment) Signed-off-by: Max <max@nextcloud.com>
In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment) Signed-off-by: Max <max@nextcloud.com>
Backport of #4381. In collectives pages optionally have an emoji set. Once this is set there is currently no way to remove it. Enhance the emoji picker to show the currently selected emoji and enable unselecting it to clear the previous selection. See also: * nextcloud/collectives#422 * serebrov/emoji-mart-vue#253 (comment) Signed-off-by: Max <max@nextcloud.com>
For us this issue is solved with the suggested solution by @serebrov. See https://github.com/nextcloud-libraries/nextcloud-vue/pull/4381/files#diff-d7f3b7d9ce2fc5c58387de5832a3ab1720a143d1032e1ed2134927a6491b6e6dR163-R179 for the code how we implemented the unselect option in Nextclouds |
It would be really helpful if the emoji picker could (optionally) provide a a way to unselect an emoji (or select "none").
When using the picker for selecting an emoji for an object (e.g. "choose the emoji for this document"), people expect to be able to remove the selected emoji later (without having to choose a different emoji). On the other hand, having a separate option in the UI just to unselect the emoji, would be a bit too much.
So it would be really handy if the picker would support a property like
emptySelection
that exposes the option to select "empty emoji" inside the picker (which then would return e.g. an empty/nullemoji
object).Do you think that's feasible?
Thanks a lot for maintaining emoji-mart-vue, it's a very useful piece of software. We use it in a lot of places for picking emojis in the Nextcloud UI.
The text was updated successfully, but these errors were encountered: