From 4534cf2af6d9e8045f687f53d3f3d559d976bffa Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 16 Jul 2024 11:14:36 -0400 Subject: [PATCH 1/2] fix(remove_all_fill): copy `tag` before modify Fixes #1538 --- shiny/ui/fill/_fill.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shiny/ui/fill/_fill.py b/shiny/ui/fill/_fill.py index 6c210c038..e615d3c50 100644 --- a/shiny/ui/fill/_fill.py +++ b/shiny/ui/fill/_fill.py @@ -127,8 +127,8 @@ def remove_all_fill( Returns ------- : - The original :class:`~htmltools.Tag` object with filling layout attributes - removed. + A copy of the original :class:`~htmltools.Tag` object with filling layout + attributes removed. See Also @@ -137,9 +137,10 @@ def remove_all_fill( * :func:`~shiny.ui.fill.as_fillable_container` """ - tag.remove_class(FILL_CONTAINER_CLASS) - tag.remove_class(FILL_ITEM_CLASS) - return tag + res = copy(tag) + res.remove_class(FILL_CONTAINER_CLASS) + res.remove_class(FILL_ITEM_CLASS) + return res # Method currently not exposed, but implemented within bslib From e6313e2317dc00481cd07a582326fd5d5292ca9c Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 16 Jul 2024 11:33:33 -0400 Subject: [PATCH 2/2] docs: Add changelog item --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b92740236..24ec5a5d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * 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) +* `remove_all_fill(tag)` no longer modifies the original `tag` input and instead returns a modified copy of `tag`. (#1538) + ### Other changes