craft.js icon indicating copy to clipboard operation
craft.js copied to clipboard

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

Open Spenc84 opened this issue 5 years ago • 2 comments

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/[email protected]
React [email protected]
TypeScript
Browser Chrome - Version 86.0.4240.198 (Official Build) (64-bit)
npm/Yarn
Operating System

Spenc84 avatar Nov 18 '20 21:11 Spenc84

Oh nice catch! Will see into it!

prevwong avatar Jan 18 '21 02:01 prevwong

This is still a bug.

eschiebel avatar Sep 24 '24 19:09 eschiebel