Skip to content

Commit c3758b6

Browse files
authored
fix(remove_all_fill): copy tag before modifying it (#1539)
1 parent b77289e commit c3758b6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5353

5454
* Made sure all `@render.data_frame` cells that have been edited are now restored back to ready state to handle the off chance that the returned patches are at different locations the the original edit patches. (#1529)
5555

56+
* `remove_all_fill(tag)` no longer modifies the original `tag` input and instead returns a modified copy of `tag`. (#1538)
57+
5658

5759
### Other changes
5860

shiny/ui/fill/_fill.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def remove_all_fill(
127127
Returns
128128
-------
129129
:
130-
The original :class:`~htmltools.Tag` object with filling layout attributes
131-
removed.
130+
A copy of the original :class:`~htmltools.Tag` object with filling layout
131+
attributes removed.
132132
133133
134134
See Also
@@ -137,9 +137,10 @@ def remove_all_fill(
137137
* :func:`~shiny.ui.fill.as_fillable_container`
138138
"""
139139

140-
tag.remove_class(FILL_CONTAINER_CLASS)
141-
tag.remove_class(FILL_ITEM_CLASS)
142-
return tag
140+
res = copy(tag)
141+
res.remove_class(FILL_CONTAINER_CLASS)
142+
res.remove_class(FILL_ITEM_CLASS)
143+
return res
143144

144145

145146
# Method currently not exposed, but implemented within bslib

0 commit comments

Comments
 (0)