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

Empty field even if value stored in database #28

Open
5ika opened this issue Mar 19, 2024 · 3 comments
Open

Empty field even if value stored in database #28

5ika opened this issue Mar 19, 2024 · 3 comments

Comments

@5ika
Copy link

5ika commented Mar 19, 2024

I'm using last version of Strapi (v4.20.5). When I load a page with the custom field, the field is always empty, even if it has data stored.

The problem I see: There are two renders of MultiSelect component. A first one with value props empty ('') and a second one with the filled value. But as it uses the defaultValue props of React Select to provide the value, the first empty value is kept.

If I replace defaultValue by value in React Select props, field is correctly filled.

Does anyone else have the same problem with the last version of Strapi ?

@5ika 5ika changed the title Empty field event if value stored in database Empty field even if value stored in database Mar 25, 2024
5ika added a commit to 5ika/strapi-plugin-multi-select that referenced this issue Jun 14, 2024
@5ika
Copy link
Author

5ika commented Jun 14, 2024

For those who need this fix, you can find a modified version of the plugin here => https://github.com/5ika/strapi-plugin-multi-select

# Using Yarn
yarn add strapi-plugin-multi-select@https://github.com/5ika/strapi-plugin-multi-select.git

# Or using NPM
npm install git+https://github.com/5ika/strapi-plugin-multi-select.git

@kristiczk
Copy link

For those who need this fix, you can find a modified version of the plugin here => https://github.com/5ika/strapi-plugin-multi-select

# Using Yarn
yarn add strapi-plugin-multi-select@https://github.com/5ika/strapi-plugin-multi-select.git

# Or using NPM
npm install git+https://github.com/5ika/strapi-plugin-multi-select.git

Thank you!

@Zaydme
Copy link
Owner

Zaydme commented Oct 10, 2024

Hey @5ika, thank you for the fix, if you don't mind creating a PR, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants