Skip to content
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

Bug: Firefox Android not triggering onSelect in <input> when dragging cursor #25643

Closed
AndreasBBS opened this issue Nov 7, 2022 · 4 comments
Closed
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@AndreasBBS
Copy link

React version:

Steps To Reproduce

  1. Open the codepen linked below in Firefox on Android ( I suspect it's also a bug in Iphone but cannot confirm)
  2. Write some text in the text input
  3. Drag the cursor
  4. Notice that the event is not triggered when the cursor is dragged

Link to code example: https://codepen.io/AndreasBBS/pen/ExRgdgN (codesandbox was down at the moment I was testing this)

The current behavior

Firefox:

Record_2022-11-07-02-39-11.mp4

The expected behavior

Chrome/Brave:

Record_2022-11-07-02-40-48.mp4

Extra Details

This seems to have to do with how Firefox implements the selectionchange event for inputs. According to this documentation, firefox fires the selectionchange 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.

@AndreasBBS
Copy link
Author

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

@AndreasBBS
Copy link
Author

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?

Copy link

github-actions bot commented Apr 9, 2024

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!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 9, 2024
Copy link

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!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

1 participant