cybersemics / em

A beautiful, minimalistic note-taking app for personal sensemaking.
Other
286 stars 115 forks source link

[mobile] ColorPicker: Maximum update depth exceeded #2508

Open raineorshine opened 1 week ago

raineorshine commented 1 week ago

Only occurs in mobile Safari.

This is a regression from #2429.

Steps to Reproduce

  1. Create a thought.
  2. Toggle the ColorPicker in the Toolbar.

Current Behavior

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops

Expected Behavior

ColorPicker should open and work as expected.

raineorshine commented 1 week ago

I find this very perplexing, but it is caused by the border style:

https://github.com/cybersemics/em/blob/6e55be0339335024f71aee7336a7c0c799990942/src/components/ColorPicker.tsx#L147

Even a static border causes the error:

    border: 'solid 1px white'
raineorshine commented 6 days ago

Border was temporarily removed in bf8140e4381c499147b87d613db291c0dde265d6. Original issue remains.