Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cb20cbb

Browse files
committedMar 3, 2025
Bugfix drag and drop
1 parent c54a2bd commit cb20cbb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎plotly/basedatatypes.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -4682,6 +4682,7 @@ def __getitem__(self, prop):
46824682
CompoundArrayValidator,
46834683
BaseDataValidator,
46844684
)
4685+
from .validators.layout._shapes import ShapesValidator
46854686

46864687
# Normalize prop
46874688
# --------------
@@ -4707,7 +4708,6 @@ def __getitem__(self, prop):
47074708
)
47084709

47094710
validator = self._get_validator(prop)
4710-
47114711
if isinstance(validator, CompoundValidator):
47124712
if self._compound_props.get(prop, None) is None:
47134713
# Init compound objects
@@ -4719,8 +4719,14 @@ def __getitem__(self, prop):
47194719
self._compound_props[prop]._plotly_name = prop
47204720

47214721
return validator.present(self._compound_props[prop])
4722+
elif isinstance(validator, ShapesValidator):
4723+
props = []
4724+
if self._props is not None and prop in self._props:
4725+
props = [validator.data_class() for _ in self._props.get(prop, [])]
4726+
4727+
return validator.present(props)
47224728
elif isinstance(validator, (CompoundArrayValidator, BaseDataValidator)):
4723-
if self._compound_array_props.get(prop, None) is None:
4729+
if not self._compound_array_props.get(prop, None):
47244730
# Init list of compound objects
47254731
if self._props is not None:
47264732
self._compound_array_props[prop] = [

0 commit comments

Comments
 (0)
Please sign in to comment.