You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an emoji Picker in my react project, which renders conditionally based on an emojiPickerVisible state.
A button sets it true and I have the onClickOutside prop setting it to false. The problem is that onClickOutside triggers with when I click the button. I managed a workaround using setTimeout but is there a better way?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have an emoji Picker in my react project, which renders conditionally based on an emojiPickerVisible state.
A button sets it true and I have the onClickOutside prop setting it to false. The problem is that onClickOutside triggers with when I click the button. I managed a workaround using setTimeout but is there a better way?
onClickOutside={() => setEmojiPickerVisible(false)}
<div onClick={() => setTimeout(() => { setEmojiPickerVisible(true)}, 0)}>
Beta Was this translation helpful? Give feedback.
All reactions