Skip to content

Commit d8619b9

Browse files
committed
Fix FigureWidget compound array property synchronization (Fixes #5689)
1 parent 15f33d2 commit d8619b9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎plotly/basedatatypes.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5458,6 +5458,16 @@ def _dispatch_change_callbacks(self, changed_paths):
54585458
-------
54595459
None
54605460
"""
5461+
# Invalidate cache for changed compound array properties so that they are
5462+
# reconstructed from the underlying properties dictionary on the next access.
5463+
# We only pop from _compound_array_props because compound arrays are immutable
5464+
# tuples that must be rebuilt to reflect added or removed elements.
5465+
for path in changed_paths:
5466+
if len(path) > 0:
5467+
prop = path[0]
5468+
if prop in self._compound_array_props:
5469+
self._compound_array_props.pop(prop, None)
5470+
54615471
# Loop over registered callbacks
54625472
# ------------------------------
54635473
for prop_path_tuples, callbacks in self._change_callbacks.items():

0 commit comments

Comments
 (0)