Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creatable multi select "Create" word added with new option randomly, while pasting and adding the new option. #4122

Closed
reidharry opened this issue Jul 13, 2020 · 7 comments
Labels
issue/bug-confirmed Issues about a bug that has been confirmed by a maintainer issue/reviewed Issue has recently been reviewed (mid-2020)

Comments

@reidharry
Copy link

reidharry commented Jul 13, 2020

Are you asking a question?

No, reporting a bug

Are you reporting a bug or runtime error?

Bug. When adding a new option by pasting the content in the Creatable multi-select "Create" option also added with a new option randomly. I have checked in the demo also bug was reproduced, Steps to reproduce given below along with bug video also attached for your reference.

Bug video

Creatable - React Select (1)

Steps to reproduce

  1. Paste some words in the select box, and click "Create new" option which shows up.
  2. Then, remove the added word, again paste the same word and click "Create new" option, that case "Create" word also added with option
@hmtri1011
Copy link

hmtri1011 commented Jul 13, 2020

Same here, seem like it is a bug, in my case I have customized formatCreateLabel and onCreateOption
image

Sometimes, my custom onCreateOption function does not execute and after that my custom formatCreateLabel appeared as a creatable value
image

@ebonow
Copy link
Collaborator

ebonow commented Jul 16, 2020

Can confirm that this is a bug. It appears that the second time around, the option is being "selected" instead of "created"

Screen Shot 2020-07-15 at 10 17 01 PM

@bladey bladey added issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet issue/reviewed Issue has recently been reviewed (mid-2020) labels Jul 16, 2020
@reidharry
Copy link
Author

@ebonow

thnx, for helping us, Yes that's a bug

@ebonow
Copy link
Collaborator

ebonow commented Jul 16, 2020

Looks like this might be related and if so there appears to be a MR that could resolve this.

#3988

@bladey bladey added issue/bug-confirmed Issues about a bug that has been confirmed by a maintainer and removed issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet labels Jul 17, 2020
@bladey bladey added issue/reviewed Issue has recently been reviewed (mid-2020) and removed issue/reviewed Issue has recently been reviewed (mid-2020) labels Aug 24, 2020
@luknl
Copy link

luknl commented Aug 24, 2020

I'm using <AsyncCreatableSelect>, and in my case, I was having this same error, but randomly without having to follow your steps, simply trying to add a new chip.
I fixed it by setting allowCreateWhileLoading to false.

Can someone reproduce this one as well? And should I create another issue for this or are they related?
Thanks!

Here is my code:

<AsyncCreatableSelect
          cacheOptions
          isMulti
          defaultValue={value}
          defaultOptions={false}
          loadOptions={loadOptions}
          onChange={handleChange}
          placeholder={placeholder}
          // allowCreateWhileLoading={true} // had to comment this to quickfix
        />

@vjpr
Copy link

vjpr commented Sep 23, 2020

I have seen this happening to with allowCreateWhileLoading. It prevents the 'create-option' being used, and instead causes a select-option event. It also prevents onCreateOption being called.

@ebonow
Copy link
Collaborator

ebonow commented Feb 11, 2021

Greetings everyone, I am happy to report that it appears that this issue was resolved by PR #4154 which was released in version 3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-confirmed Issues about a bug that has been confirmed by a maintainer issue/reviewed Issue has recently been reviewed (mid-2020)
Projects
None yet
Development

No branches or pull requests

6 participants