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

modcard hotkey issues (2/2): After hotkey close, non-existent card continues to receive onKeyDown events #3272

Closed
Nareese opened this Issue Sep 22, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@Nareese
Contributor

Nareese commented Sep 22, 2018

This is the second of two modcard hotkey issues. The first is in #3270.

The second issue is a long standing issue that I have been trying on and off for months to track down, and for the life of me, I just can't figure it out. When the modcard closes due to a hotkey firing ModeratorCard.close(), the card will disappear, but will somehow continue to receive onKeydown events. This only happens on hotkey. If you manually click the X on the card, it will NOT receive events. After closing a modcard with any hotkey (including ESC), if you don't click into the chat textarea, and hit a modcard hotkey, that key will be passed to the now invisible modcard. This has resulted in numerous times where I have accidentally started typing without having clicked into the textarea properly, and if what I type contains a p, b, t, etc... bad results happen.

The onClose handler in chat_moderator_card/index.js should be and is called when the card closes, and should and does set openModeratorCard to null. The onKeyDown handler is supposed to return without passing the keystroke to the card if openModeratorCard is not set, but when a hotkey is pressed per the reproduction steps above, onKeyDown is called, and openModeratorCard is somehow set to a ModeratorCard object that has the same data as the previously selected card, even though it was just set to null, and no card has been opened since. I obviously do not have a fix for this because I have no clue why its happening.

@Nareese Nareese changed the title from modcard hotkey issues (2/2): After hotkey close, non-existent card retains focus to modcard hotkey issues (2/2): After hotkey close, non-existent card continues to receive onKeyDown events Sep 22, 2018

@night night closed this in 381b770 Sep 30, 2018

@night night added the bug label Sep 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment