casesandberg / casesandberg/react-color

Color picker UI does not update on drag (possibly related to SSR)

Open
#760 12 comments 5 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Hi there — first off, thanks for making this!

I implemented this and I'm seeing the following error in console:

```
Warning: Prop `style` did not match. Server: "position:absolute;top:0px;right:0px;bottom:0px;left:0px;background:url(null) center left" Client: "position:absolute;top:0px;right:0px;bottom:0px;left:0px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) center left"
in div (created by Checkboard)
in Checkboard (created by Chrome)
```

We are using NextJS so I'm wondering if the issue comes from that.

Dragging still works in that it returns the proper value in `onChange`, but it does not update the UI so it looks like it's stuck.

![Screen Recording 2020-09-07 at 11 14 AM](https://user-images.githubusercontent.com/120388/92411110-6890d080-f0fb-11ea-9686-19be0af8a9f4.gif)

Contributor guide

Open the contributing guide

Research direction

Begin with the Checkboard component named in the warning and reproduce the color picker under Next.js server-side rendering. Compare the server and client styles while dragging, then verify that the picker UI updates visually without the hydration mismatch and that onChange still returns the correct value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.