Opening Two Emoji Menus Breaks the Awards Handler
Summary
Opening 2 emoji menus breaks the page and prevents any more emoji menus from opening.
Steps to reproduce
- Open an issue or MR with comments
- Click the
😃 icon to open an emoji menu - Click the
😃 icon on a different comment (or description)- It is important not to click anything else before opening the second emoji menu
- The first menu must be closed using the same click event that opens the second menu
Example Project
This issue.
What is the current bug behavior?
The second emoji menu animates open, but immediately closes. Any subsequent attempts to open any emoji menu on the page fail in the same way.
What is the expected correct behavior?
The emoji menu should open in the new location and stay open.
Output of checks
This bug happens on GitLab.com
Possible fixes
Centralize the menu close state logic into a function, clear the "current" awards block before setting it again, and allow the emoji menu to close-open without an animation.