Closed AndreasBBS closed 6 months ago
I believe something in here needs to be changed. There's a comment saying:
// Firefox doesn't support selectionchange, so check selection status
// after each key entry. The selection changes after keydown and before
// keyup, but we check on keydown as well in the case of holding down a
// key, when multiple keydown events are fired but only one keyup is.
// This is also our approach for IE handling, for the reason above.
But according to Firefox documentation it's not true: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/selectionchange_event
I've been trying to fix this and I can't get the event triggered on the input node to even reach the SelectEventPlugin.js @gaearon @kassens Sorry to bother but I noticed that you've been involved in the implementation of this plugin. Could you give me some directions on how you think that conceptually I could integrate the behavior supported by Firefox into this plugin?
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!
React version:
Steps To Reproduce
Link to code example: https://codepen.io/AndreasBBS/pen/ExRgdgN (codesandbox was down at the moment I was testing this)
The current behavior
Firefox:
https://user-images.githubusercontent.com/12399440/200215567-0f785f12-017b-41a9-bacf-fce3ffe8e46a.mp4
The expected behavior
Chrome/Brave:
https://user-images.githubusercontent.com/12399440/200215632-8ded87ff-cda8-44f9-b3f6-c00848425869.mp4
Extra Details
This seems to have to do with how Firefox implements the
selectionchange
event for inputs. According to this documentation, firefox fires theselectionchange
event on the input node instead of on document. In fact, if you try the little snippet they have in the documentation you'll find that it only works on Firefox and not any other browser. I'm not sure if other browsers are gonna move in this direction, but if they do, this bug will become more common. Chrome already has a bug report and if they 'fix' it, this behavior will also happen there.