React-color: display property in docs not working

Created on 15 Mar 2016  路  9Comments  路  Source: casesandberg/react-color

The docs describe a display property to make the color pickers work like a popup. Adding this property as described here http://casesandberg.github.io/react-color/#api-display didn't work for me. When I looked through the code, I could not find anywhere where this display property gets used. Are the docs out of date or am I missing something?

Most helpful comment

Fair to say there are arguments for both sides of this debate. Regardless, I'd suggest removing things from the docs that aren't supported and/or contain incomplete sample code.

All 9 comments

Experienced the same issue here. I rollbacked to the 1.3.0 version and it worked as expected.

Hey, thanks for react-color. It's really nice.

Regarding the issue: IMO this component should not concern itself with display and position. React have booth built-in and third party solutions for that. E.g. one can easily wrap color picker in a div and set it's style (display, postiion) depending on state / props / whatever. Even better one can render the picker conditionally.

What I mean is that maybe instead of making display, position and positionCSS props work again, they should be removed from docs and the popup example should be updated.

What do you think of that?

@lzrski I see one issue for color-picker not concerning itself with display and position; it's make difficult to close the color picker when you click outside it (the behavior that I use with 1.3.x).

@slestang that's a concern of a modal component. Try https://github.com/reactjs/react-modal for example. You can put react-color component inside modal to get the functionality you are describing. To close modal when user picked a color just close it inside onChangeComplete handler of react-color.

Fair to say there are arguments for both sides of this debate. Regardless, I'd suggest removing things from the docs that aren't supported and/or contain incomplete sample code.

Does anyone know why version 2.0, which is the release version, lost a bunch of features? What's the status of the project and the 2.X version?

If the features are removed it only makes sense to increment major version: http://semver.org/#spec-item-8.

@lzrski: I agree, whether or not it's the right thing to keep this feature, it should not be in the docs and version should change. I ended up forking the repo and adding in the feature myself so the change didn't break my implementation.

Sorry everyone, I just found out that when I released 2.0.0 I forgot the push the new documentation to the github pages. It has been updated now and can be found here: http://casesandberg.github.io/react-color/

TL;DR Display prop has been deprecated, either use state and onClick to show and hide it or use another component

Was this page helpful?
0 / 5 - 0 ratings