Skip to content

selectOptions triggers change twice #917

@ghost

Description

Reproduction example

https://codesandbox.io/s/gracious-tess-xtusee?file=/src/App.test.js

Prerequisites

  1. Render two <select onChange={handleChange}> elements
  2. call selectOptions for one, then another (or call for one then do userEvent.tab())

Expected behavior

onChange is called one time

Actual behavior

onChange is called twice. First time when selecting option, second time when changing option for other <select/> or tabbing out.

User-event version

14.0.4

Additional context

This was not a problem in v13: https://codesandbox.io/s/crazy-bas-1vvrhy?file=/src/App.test.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions