Comments (7)
This was not fixed, right?
onRequestAdd receives an object (if you use dataSource
and dataSourceConfig
) while onRequestDelete receives a string, being just the value of the item in the data source.
e.g.
onRequestAdd({ label: "Some label", value: "SOME_ENUM_VALUE"});
onRequestDelete("SOME_ENUM_VALUE");
from material-ui-chip-input.
It was fixed, but in the other way: onRequestDelete
no always gets called with the value (which is either the string or the value
property when using dataSourceConfig
.
from material-ui-chip-input.
Isn't this inconsistent?
You get the item in one, the value in another. Sure, sometimes the item is a string, sometimes it contains a text/label and the value string.
Seems to me that it would be more consistent to stick to either value or the complete item.
Anyways, I work around it by translating it so I can use it in redux-form.
from material-ui-chip-input.
Yes, but at least it's consistent for onRequestDelete
calls, which it wasn't before. Making it consistent between onRequestAdd
and onRequestDelete
would be a breaking change, unfortunately (and I don't want to break everyone's code even if this is < 1.0.0).
I could do that when I update this to material-ui@next and bump the version to 1.0.0, though. π Could you please open a new issue for that?
from material-ui-chip-input.
Done. Awesome work, btw. :)
I'll probably wrap it in a new lib, that support redux-form and that can integrate into Google Places. Soonish or laterish
from material-ui-chip-input.
Thank you, @advance512
That sounds like a good idea. I have an example for formsy support here, it may help you when building a redux-form wrapper.
Let me know when you're done, I'd like to link that as related project. π
from material-ui-chip-input.
I have the redux-form wrapper, actually. I had to split it into two:
A "multi-select" and a "tags input". The reason is that with a DataSource, I need to use onRequestAdd, but without one, I need to use onChange (which, btw, gives you the complete list of items, also a tad inconsistent, but there IS only one handler).
I don't have time to port my existing, ugly, component that merge react-places-autocomplete
and react-select
to do the Google Places thing, but I will soon - it's the only non-Material UI component I currently use.
from material-ui-chip-input.
Related Issues (20)
- On Android Mobile: newChipKeys not working HOT 1
- dataSource is not working HOT 1
- Update storybook examples
- How to add date/datetime values as chips?
- Can I add icon to input field like in TextField by using Input Adornments?
- Label positioning on "outlined" variant is incorrect.
- Dependency version mismatch error: Unable to install this module HOT 12
- Dependency error with material-ui/core v5 HOT 3
- Make chips editable in the same place HOT 1
- "future" compatibility issue HOT 1
- Module not found HOT 1
- Make ChipInput a required field in a form HOT 1
- Chip note adding using space bar HOT 1
- MUI v5 HOT 1
- Please add React 17 support HOT 7
- Is there a way to change OnBlur so that focusing and then clicking on a chip doesn't trigger it?
- Submit button not working after update the Android system WebView in android device.
- Performance issue with pasting 100+ items in chip input. Cannot add more chips and DOM freezes
- Should ChipInput component be wrapped by Form tag ?
- unable to install in react 18v 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 material-ui-chip-input.