You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that I use latest version of all @mantine/* packages
What version of @mantine/* packages do you have in package.json?
7.10.2
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
All
Describe the bug
When you select an option from the dropdown with the arrow keys + Enter key, it will cause the onChange to fire twice if there was a search on the input. This is probably caused by the Enter base action, which will submit the value even if it's not in the dropdown, plus the select option action.
If there is no search, it will only fire once. If the option is selected with the mouse, it will only fire once as well. In those cases it works as intended.
Steps to reproduce: In a list with the option "react", type "re" on the TagsInput, then navigate to the option with the arrow keys, and press Enter key. It will fire first for the value "re", and then for "react".
If possible, include a link to a codesandbox with a minimal reproduction
I fixed it and updated it to the latest Mantine version (7.11.0).
As a sidenote, I noticed the prop selectFirstOptionOnChange on TagsInput doesn't seem to be used anywhere (besides props' destructuring), nor does anything. It's also in the docs' props tab, but I'm not sure if it's a mistake from copy pasting from other components like Select/MultiSelect, or it's missing the effect said components have but it's meant to have the functionality.
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.10.2
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
All
Describe the bug
When you select an option from the dropdown with the arrow keys + Enter key, it will cause the onChange to fire twice if there was a search on the input. This is probably caused by the Enter base action, which will submit the value even if it's not in the dropdown, plus the select option action.
If there is no search, it will only fire once. If the option is selected with the mouse, it will only fire once as well. In those cases it works as intended.
Steps to reproduce: In a list with the option "react", type "re" on the TagsInput, then navigate to the option with the arrow keys, and press Enter key. It will fire first for the value "re", and then for "react".
If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/determined-morse-2kyvpl
Possible fix
Prevent the
Enter
action to fire the first onChange if there is an option already selected in the dropdown.I'm willing to implement a fix for this, if it's considered an issue.
Self-service
The text was updated successfully, but these errors were encountered: