ealush / emoji-picker-react

The most popular React Emoji Picker
https://ealush.com/emoji-picker-react/
MIT License
1.08k stars 176 forks source link

Loss of focus in the presence of a corette pointing at a smiley face. #320

Open Binatik opened 1 year ago

Binatik commented 1 year ago

I'm trying to use emoticons inside contentEditable. There I can edit the text and have a corette. As soon as I'm in the open menu where the smiley face is, I lose focus

I tried to find props setting that would cancel this behavior, but I couldn't figure it out.

I ask you to note that this should work with previews.

ealush commented 1 year ago

Hey👋 I'm not sure what exactly you're experiencing. Can you share a video of the issue?

donnikitos commented 1 year ago

+1 The input looses focus whenever you start hovering over an emoji:

https://user-images.githubusercontent.com/5833538/220611559-68d954cc-5af8-453f-82ea-c278e0102374.mp4

ealush commented 1 year ago

This is the intended behavior, as it enhahces the keyboard navigation capabilities.

Once you hover over an emoji, or even scroll down, you can continue with keyboard navigation. Hitting esc, for example, will bring the focus back to the input.

How else would you prefer that? A prop to control this behavior, or another way to flip the default?

donnikitos commented 1 year ago

IMO that behavior is not fully intuitive, e.g. if you open the selector in a popup and hover an emoji you are not able to continue typing.

Have you considered using a simulated focus state? E.g. you could store the last hovered emoji in a state and navigate via keyboard from there

ealush commented 1 year ago

Yes, I have, but I believe that may introduce a different set of problems.

Now, when you hit left or right, do you move the cursor, or the emojis?

One thing we may consider is changing the behavior if the input has text, but I am still not certain it would make the problem go away

devmalcolm commented 5 months ago

Hey👋 I heard v4 was here, and i still was wondering if this issue still active? I re-installed the package, and it seems that the loss focus issue still appeared, after reading the doc i sadly do not find a way to control this behavior, does it planned to be fixed ? Thanks !