prevwong / craft.js

🚀 A React Framework for building extensible drag and drop page editors
https://craft.js.org
MIT License
7.57k stars 737 forks source link

Changing the hidden prop on Element doesn't update the corresponding node #143

Open Spenc84 opened 3 years ago

Spenc84 commented 3 years ago

Describe the bug The docs indicate that the \<Element> component accepts a prop 'hidden' that can be used to control whether or not a node's user component is hidden or visible. The initial value of that prop seems to work fine, but modifying the value of that prop after the node is created appears to have no effect.

To Reproduce Steps to reproduce the behavior:

  1. Render an Element component with a variable hidden prop (eg. \<Element is='button' hidden={conditional} />)
  2. Alternate the value of the conditional between true and false.
  3. React's inspector shows the value of the prop changing, but the value of node.data.hidden appears to remain constant.

Expected behavior My expectation was that modifications made to the prop values of an Element component would in turn update the corresponding properties of the Node object.

Your environment

Software Version(s)
craft.js @craftjs/core@0.1.0-beta.13
React react@16.12.0
TypeScript
Browser Chrome - Version 86.0.4240.198 (Official Build) (64-bit)
npm/Yarn
Operating System
prevwong commented 3 years ago

Oh nice catch! Will see into it!

eschiebel commented 2 weeks ago

This is still a bug.