furqanZafar / react-selectize

http://furqanzafar.github.io/react-selectize/
Apache License 2.0
704 stars 138 forks source link

Feat: New `readOnly` property in the component's API #173

Open green2k opened 7 years ago

green2k commented 7 years ago

Using this new property, we can set the component as readOnly, so no custom text-input will be allowed.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 88.316% when pulling f877909f2e5d828c09f6ebc68f6a72d57cb65d87 on green2k:property-readOnly into d3f707235cf4f8fca3646421861688678f70f045 on furqanZafar:master.

elisherer commented 7 years ago

You can do inputProps={ readOnly: true } instead, I think this PR is just a syntactic sugar.

green2k commented 7 years ago

This PR actually adds the readOnly property into the SimpleSelect & MultiSelect components, so we can properly use it. If there's already some other options about how to mark the input element as read only, then it's maybe missing in the API documentation. However, I've migrated to react-select a couple of days ago, so this issue can be closed :slightly_smiling_face:

joevo2 commented 7 years ago

@elisherer inputProps is a valid property? doesn't seems to exists in SimpleSelect though.

elisherer commented 7 years ago

@joevo2 , it does: https://github.com/furqanZafar/react-selectize/blob/d3f707235cf4f8fca3646421861688678f70f045/src/SimpleSelect.ls#L81

joevo2 commented 7 years ago

@elisherer I see... cause I couldn't find it here. and my tslint is being annoying. any idea why? sorry for the trouble though 😢 screen shot 2017-10-23 at 4 03 51 pm

update: oh you guys forget to update this file? 😄 https://github.com/furqanZafar/react-selectize/blob/master/src/index.d.ts

green2k commented 7 years ago

You're right, the inputProperty property is not valid, as it's not specified in the type definition.

joevo2 commented 7 years ago

@green2k I just need to add the type definition into this file then it should work? send a PR? https://github.com/furqanZafar/react-selectize/blob/master/src/index.d.ts sorry im kinda new with ts and oss stuff 😅