question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MultiSelect - an unexpected behavior makes the component unusable when in a certain controlled state

See original GitHub issue

What package has an issue

@mantine/core

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:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
rtivitalcommented, Aug 9, 2022

Thanks for reporting, the issue will be fixed in one of the next patches

1reaction
dipiashcommented, Aug 17, 2022

@rtivital, hi!

Tell us please, when the new version with fix will be release?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found