question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CustomPicker broken on 2.18.0 version

See original GitHub issue

Hi all,

Want to share an issue which happened on my project after updating the package from 2.17.3 to 2.18.0 version, which forced me to downgrade the version.

I am using Saturation, Hue and EditableInput components wrapped by CustomPicker.

Seems like in 2.18.0 version the onChange method is broken and the value is not updating correctly which causes a UI bug.

Here is a simplified snippet from my code.

Thanks in advance

`const MyPicker = ({ hsl, onChange, hsv, hex }) => { const changePicker = useCallback((e) => { onChange(e); // Some local state management }, []);

const changeInputValue = useCallback((e) => {

    if (typeof onChange === 'function') {
        onChange(e.hex);
    }

}, [onChange]);

const pickerProps = {
    hsl,
};

const saturationProps = {
    ...pickerProps,
    hsv,
};

return (
    <div className={classes.colorPickerContainer}>
        <Saturation {...saturationProps} onChange={changePicker}/>
        <Hue {...pickerProps} onChange={changePicker}/>
        <EditableInput value={hex ? hex.slice(1) : 0} label={'hex'} onChange={changeInputValue} />
    </div>
);

};

export default memo(CustomPicker(MyPicker));`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
joncursicommented, May 4, 2020

@casesandberg I’m still seeing this same issue in v2.18.1 where onChange is not propagating the new color result in the Saturation component (hue is working fine).

1reaction
pailheadcommented, Jun 17, 2020

Thank you, reverting to 2.17.3 fixed my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android App Changelog - ownCloud
Upgrading from 2.18 or older versions made the app crash due to camera uploads ... The following sections list the changes in ownCloud...
Read more >
office-ui-fabric-react - UNPKG
640, "version": "7.149.3",. 641, "comments": {. 642, "patch": [. 643, {. 644, "comment": "SplitButton: Fix ariaDescription behavior so that it is correctly ...
Read more >
react-color: Versions - Openbase
Full version history for react-color including change logs. ... (BlockPicker): fixes blockpicker input not working: #616 ... 2.18.0. 3 years ago ...
Read more >
:art: Color Pickers from Sketch, Photoshop, Chrome, Github ...
Hence its does not allow us to choose a color in the latest version 2.18.0. Everything works fine on rolling back to 2.17.3....
Read more >
A highly customizable Flutter color picker.
Pub Version GitHub Workflow Status (event) Test codecov License ... If you enabled the custom picker and have not provided any custom color ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found