dash-html-components icon indicating copy to clipboard operation
dash-html-components copied to clipboard

Details open attribute isn't working for callbacks

Open nico-bohlinger opened this issue 6 years ago • 0 comments

You can set the open attribute for the details component correctly but you can't change it afterwards in a callback. This seems to be a problem with react and I found this solution:

const onToggle = event => {
  event.preventDefault();
  setOpen(!open);
};

// Later on...
return (
  <div className="App">
    <details open={open} onClick={onToggle}>...</details>
  </div>
)

Source: https://github.com/facebook/react/issues/15486

Could somebody fix this?

nico-bohlinger avatar Oct 28 '19 14:10 nico-bohlinger