Skip to content

Dropdown of searchable Select component is automatically opened again when browser window is focussed again #5893

@mark-pfeifle

Description

@mark-pfeifle

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.6.1

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

Steps to reproduce:

  • Select an option in a searchable "Select" component (e.g. https://mantine.dev/core/select/#searchable)
  • Leave focus on that Select (i.e. do not click anywhere on the site afterwards)
  • Unfocus Browser window by focussing e.g. text editor or other Window
  • Click on the area where the dropdown of the Select has previously been

Behavior: On Browser window re-focus, the dropdown is automatically opened again, and the corresponding option where you clicked is selected.

This seems harmless at first, but it is really annoying when multiple selects are stacked, and one tries to e.g. copy & paste text from a text editor to the browser to input specific values into the search inputs (The upper Select is then uncontrollably changed when one tries to paste something in the second select).

If possible, include a link to a codesandbox with a minimal reproduction

https://mantine.dev/core/select/#searchable

Possible fix

Modify this line:

Self-service

  • I would be willing to implement a fix for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions