Closed Tadaboody closed 6 years ago
Select search input after having chat input focused.
Type things into search.
Focus switches to chat input.
It looks like if I do this in the console, I can get functionality working:
chatInput.blur();
searchInput.focus();
However this doesn't seem to work if I do it in a click handler, or even consistently at all from the console.
chatInput.addEventListener('keydown', (event) => {
if (event.target !== chatInput) {
return;
}
event.stopPropagation();
});
That should do the trick. I don't know what exactly changed in either react or discord to make react's global listener insist on hijacking focus, but whatever, I don't really care. Stopping propagation just short-circuits the entire issue in a neat and self-contained way.
Pushing this out as a fix
Bug
Typing in the emote search switches focus to chat