zaydme / strapi-plugin-multi-select Goto Github PK
View Code? Open in Web Editor NEWA strapi custom field for a multi select input.
Home Page: https://www.npmjs.com/package/strapi-plugin-multi-select
License: MIT License
A strapi custom field for a multi select input.
Home Page: https://www.npmjs.com/package/strapi-plugin-multi-select
License: MIT License
I have a multi-select with a TON of options.
It would be really nice to be able to type in the available options with a autocomplete of whats available in the list as well as the checkboxes.
Thanks!
From options list ['a', 'b', 'c']
choose b, then a, selected values list would be ['b', 'a']
On reload, selected values lose their order, as they're filtered by possibleOptions in sanitizedValue and become ['a', 'b']
Would appreciate for this feature, thanks!
Hi,
I have a multi-select field X which is a non-required field. Initially, I got null from the API if I didn't select any values for it. However, once I selected multiple items and unselected them, I got an empty array instead of null from the API. Could you please make a change so that if there is no value selected, the API returns null?
The reason that I need such a change is that the filters don't work well with empty arrays in Strapi.
Thank you
How can I get a list of all multi-select values from graphql?
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 ?
Strapi version: 4.6.0
strapi-plugin-multi-select: 1.1.0
When adding a component with the custom multi-select plugin field to a dynamic zone, I get a "Whoops! Something went wrong. Please, try again." (see screenshot below). I've also included the console error:
TypeError: Cannot read properties of null (reading 'includes')
at ht (main.ee2267fb.js:12894:988)
at main.ee2267fb.js:12894:1690
at Array.map (<anonymous>)
at be (main.ee2267fb.js:12894:1249)
at _o (main.ee2267fb.js:9836:54688)
at l4 (main.ee2267fb.js:9840:9133)
at Fd (main.ee2267fb.js:9840:989)
at vc (main.ee2267fb.js:9840:917)
at Cc (main.ee2267fb.js:9840:768)
at Ec (main.ee2267fb.js:9838:11068)
qr @ main.ee2267fb.js:9838
Hi,
is possible for required field set a default value?
Thanks a lot. Great Job!!
I know you can use $containsi
but it doesn't really achieve what I want.
Let's use this example
"page": {
"type": "customField",
"options": ["My Account:my-account", "Account:account", "Account Edit:account-edit"],
"customField": "plugin::multi-select.multi-select"
},
$in
filters[page][$in]=account
Does not return any data, even if I have multiple entries that have account
selected
$containsi
filters[page][$containsi]=account
Returns any entries that page
value includes the account
characters and not only the account
value
[
{
"id": 1,
"attributes": {
"page": [
"my-account"
]
}
},
{
"id": 3,
"attributes": {
"page": [
"account-edit"
]
}
},
{
"id": 5,
"attributes": {
"page": [
"account"
]
}
}
]
$in
[
{
"id": 5,
"attributes": {
"page": [
"account"
]
}
}
]
At the moment, I can't use this plugin due to this missing feature.
Unless I am missing something. Any help would be greatly appreciated.
First of all, amazing work! This plugin should be included by default!
Would be great to have an option to hide it from the default API response (This field will not show up in the API response).
[
"中文:1", // Chinese
"option 2:2",
"option 3:3"
]
for column 'value' at row 1
Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87...' for column 'value' at row 1
It would be convenient to have the ability to create new values in the input field. Here is an example.
Unfortunately, Strapi is not rushing to implement this feature, and for now, we have to use repeatable relationships. Your plugin would organically solve this issue.
Hi there, this plugin causes Strapi to crash :S
Installed, rebuilded, but nothing. No custom field.
4.9.2 (node v18.12.0)
error: Cannot read properties of undefined (reading 'register')
TypeError: Cannot read properties of undefined (reading 'register')
at Object.module.exports [as register] (D:\xampp\htdocs\strapi\strapi-v4\node_modules\strapi-plugin-multi-select\server\register.js:5:25)
at Object.register (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\core\domain\module\index.js:47:46)
at Object.register (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\core\registries\modules.js:33:19)
at async Strapi.runLifecyclesFunctions (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:510:5)
at async Strapi.register (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:379:5)
at async Strapi.load (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:456:5)
at async Strapi.start (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:198:9)
I'm trying to use the operator $contains as $in doesn't work.
However, I get the following error from Strapi:
select "t0".*, "t0"."id" from "public"."articles" as "t0" where (("t0"."locale" = $1 and "t0"."featured" = $2 and "t0"."topics" like $3) and "t0"."published_at" is not null) order by "t0"."published_on" desc limit $4 - operator does not exist: jsonb ~~ unknown
error: select "t0".*, "t0"."id" from "public"."articles" as "t0" where (("t0"."locale" = $1 and "t0"."featured" = $2 and "t0"."topics" like $3) and "t0"."published_at" is not null) order by "t0"."published_on" desc limit $4 - operator does not exist: jsonb ~~ unknown
at Parser.parseErrorMessage (/opt/app/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/opt/app/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/opt/app/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/opt/app/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:514:28)
at Socket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
How to filter by this field?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.