Skip to content

Commit

Permalink
Fix bug when state changes before rendering would cause ElementNotInD…
Browse files Browse the repository at this point in the history
…om errors.
  • Loading branch information
kkinder committed Feb 22, 2025
1 parent 1b3ee0f commit 3da5d0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions puepy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,12 @@ def _retain_implicit_attrs(self):
"""
Retain attributes set elsewhere
"""
for attr in self.element.attributes:
if attr.name not in self.attrs and attr.name != "id":
self._retained_attrs[attr.name] = attr.value
try:
for attr in self.element.attributes:
if attr.name not in self.attrs and attr.name != "id":
self._retained_attrs[attr.name] = attr.value
except ElementNotInDom:
pass

def on_redraw(self):
pass
Expand Down

0 comments on commit 3da5d0d

Please sign in to comment.