Comments (6)
I also noticed that the multiSelect creates a new hidden input for every new item selected, I think this might be wrong and it should instead aggregate all the values into something like .
Hey @bryceosterhaus for this one, it is a little odd, but portal currently uses it that wya in many places. Most notably assetCategories and assetTags use it in this way. You'd need to make sure it wouldn't break the existing uses in Portal.
from clay.
@ethib137 is it expected they have the same name
too?
For some reason I thought name
must be unique, but according to this, it is expected that checkboxes can have the same name.
from clay.
Yes, same name is allowed for all inputs, and itβs expected in this case. When you access the Param on the backend it returns an array of all the values.
from clay.
ah I see.
I think my original issue still stands though... I think changing the values in MultiSelect should also reflect in a forms onChange
from clay.
I'm looking into this right now, we may probably have some native bugs here that won't work correctly or maybe due to how the multi select behavior works, for example adding labels as commented above creates an input[hidden]
for each label so that it arrives at the backend as an array, I think that adding a new input
with the value of the label will not call the onChange
of your form just in case you change the value of that input which is not the case.
Unfortunately I don't think we can change this behavior or try to simulate it for the MultiSelect labels case, I think what we can do here is just add the name to the MultiSelect input that is going to the one input[hidden]
which is not necessary in my view here.
I would say that you could use Formik here to control all the states of your form it would be "simpler" to deal with dynamic components like MultiSelect.
from clay.
I think I tried formik with a Form and MultiSelect and it didn't work properly because it wasn't able to hook into the onChange of multi-select.
Do you have an example of formik + multiSelect working?
from clay.
Related Issues (20)
- @clayui/css: c-prefers-expanded-text util breaks tab text
- Update BG color for the Beta Button and Beta Badge
- Improvements for the ClayPanel component HOT 6
- TreeView: Actions do not open by Enter key with JAWS HOT 2
- @clayui/css: Cadmin VerticalBar resizer is too narrow HOT 1
- @clayui/css: Cadmin focus-visible Clay Range doesn't show outline on tab HOT 2
- @clayui/empty-state: Append _reduced_motion to the imgSrc url by default HOT 6
- @clayui/css Cadmin modal doesn't have overflow-y: auto HOT 2
- @clayui/modal Enable modal-dialog-scrollable HOT 11
- JSP Sample Code Not Correct
- @clayui/drop-down ClayUIDropdownWithItems: RadioGroup with radio Items not getting checked HOT 1
- xlinkHref icons display error when using CDN HOT 1
- Additional notes in the getting started section HOT 2
- Add Flag of Canada HOT 1
- Can we rename ClayDatepicker property `timezone` to `timeZone`? HOT 1
- Migrating to Clay Picker HOT 1
- Unable to select pages from the ellipsis dropdown in Clay Pagination HOT 2
- Onclick not happening on Pagination ellispsis drop-down HOT 2
- Clay Navigation Bar position not correct HOT 1
- ClayTooltipProvider isn't working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clay.