dash-tabulator icon indicating copy to clipboard operation
dash-tabulator copied to clipboard

Theme not updated on callback

Open bpl-coding opened this issue 3 years ago • 0 comments

Thanks for this great library! Its been a huge help for me.

I am trying to enable a dark mode/light mode switch on my app but cannot get the dash tabulator table to respond to updating its theme property via callback.

Currently I am outputting a string ('tabulator_midnight') to Output("table", "theme"). When i check the state of the "theme" property on the table, it correctly shows "tabulator_midnight". However, the table colors are not updated. Is it only possible to set the theme in the table constructor? If so, is there anyway to trigger reconstructing the table?

Another related quirk to this: if i construct a table with one theme ("tabulator_simple") it correctly loads with that theme, but when I subsequently add another table dynamically (via pattern matching callback) that has a different theme "tabulator midnight", the original table re-renders from its set theme ("tabulator_simple") to the theme of the newly added table ("tabulator_midnight"). So it seems the table theme is being globally set to all dash tabulator instances in this scenario.

Appreciate any insight.

bpl-coding avatar Jun 20 '22 17:06 bpl-coding