Skip to content

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

@AndreasBBS

Description

@AndreasBBS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: StaleAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions