plotly / dash-html-components

OBSOLETE - now part of https://github.com/plotly/dash
https://dash.plotly.com
Other
153 stars 49 forks source link

Details open attribute isn't working for callbacks #142

Open nico-bohlinger opened 5 years ago

nico-bohlinger commented 5 years ago

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?