MultiSelect - an unexpected behavior makes the component unusable when in a certain controlled state
See original GitHub issueWhat package has an issue
Describe the bug
When MultiSelect is given a value prop and a data prop with the same value, and a true searchable prop, The following problems occur:
- The dropdown cannot be viewed as it is immediately closed.
- The blinking cursor which normally hint the user for text input is not visible.
- The user can input text but the text is not visible (or very quickly visible in a single frame)
Here is an excerpt of the codesandbox (link below) :
import { MultiSelect, Text } from "@mantine/core";
import { useState } from "react";
import "./styles.css";
export default function App() {
const [value, onChange] = useState(["foo"]);
return (
<div className="App">
<Text>value is {value}</Text>
<MultiSelect
searchable
data={["foo"]}
value={value}
onChange={onChange}
/>
</div>
);
}
What version of @mantine/hooks page do you have in package.json?
5.1.1
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/repro-multi-select-dropdown-ikmuxi?file=/src/App.tsx
Do you know how to fix the issue
No response
Are you willing to participate in fixing this issue and create a pull request with the fix
No response
Possible fix
After debugging with the help of onDropdownClose prop those lines of code are responsible of the dropdown close https://github.com/mantinedev/mantine/blob/4486a9b11f2e2817d26c88e1d3337c60ef7d1140/src/mantine-core/src/MultiSelect/MultiSelect.tsx#L314-L316
The lifecycle hooks used in MultiSelect ought to be where to investigate…
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Lifespan - Chapter 10 Flashcards - Quizlet
the ability to control when and how emotions are expressed ... understand that emotions must be managed in certain situations, and emotions affect...
Read more >No value accessor for form control with unspecified name ...
It is looks like "formControl" is reserved name by Angular Forms, when I used this name as an input to my component, I...
Read more >Grid capabilities - Finance & Operations | Dynamics 365
This article describes several powerful features of the grid control. You must enable the new grid feature to have access to these ...
Read more >22.5 Utilizing Debug Mode - Oracle Help Center
Debug mode enables you to track down unexpected application behavior. ... You can control the logging level of detail, add debug calls in...
Read more >Striking a Balance Between Native and Custom Select Elements
Here's the plan! We're going to build a styled select element. Not just the outside, but the inside too. Total styling control.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting, the issue will be fixed in one of the next patches
@rtivital, hi!
Tell us please, when the new version with fix will be release?