From fd92d88d31b9b71d3a1d84d0e09143094d1a97bf Mon Sep 17 00:00:00 2001 From: iliketocode2 Date: Wed, 25 Feb 2026 09:03:51 -0500 Subject: [PATCH 1/2] update docs for update_all changes --- pyscript/web.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pyscript/web.py b/pyscript/web.py index 7b2f98c..06d0519 100644 --- a/pyscript/web.py +++ b/pyscript/web.py @@ -119,7 +119,8 @@ # Bulk update all elements. items.update_all( innerHTML="Hello", - className="updated-item" + classes="updated-item", + style={"color": "blue"}, ) # Index and slice collections. @@ -1062,7 +1063,7 @@ class ElementCollection: item.classes.add("processed") # Bulk update all contained elements. - items.update_all(innerHTML="Hello", className="updated") + items.update_all(innerHTML="Hello", classes="updated") # Find matches within the collection. buttons = items.find("button") @@ -1159,18 +1160,19 @@ def find(self, selector): elements.extend(_find_and_wrap(element._dom_element, selector)) return ElementCollection(elements) - def update_all(self, **kwargs): + def update_all(self, classes=None, style=None, **kwargs): """ - Explicitly update all elements with the given attributes. + Explicitly update all elements with the given `classes`, `style`, and + `attributes`. Delegates to each element's `update` method. ```python collection.update_all(innerHTML="Hello") + collection.update_all(classes="active", style={"color": "red"}) collection.update_all(className="active", title="Updated") ``` """ for element in self._elements: - for name, value in kwargs.items(): - setattr(element, name, value) + element.update(classes=classes, style=style, **kwargs) # Special elements with custom methods and mixins. From b6de43d09fa88f66e77a766dc51af4d33575deb2 Mon Sep 17 00:00:00 2001 From: iliketocode2 Date: Fri, 27 Feb 2026 09:52:55 -0500 Subject: [PATCH 2/2] update dom docs --- docs/user-guide/dom.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/dom.md b/docs/user-guide/dom.md index f0930fd..d76b178 100644 --- a/docs/user-guide/dom.md +++ b/docs/user-guide/dom.md @@ -201,7 +201,8 @@ for item in items: # Bulk update all elements. items.update_all( innerHTML="New content", - classes=["updated-item"] + classes="updated-item", + style={"color": "blue"}, ) # Index and slice collections.