Skip to content

Commit

Permalink
Ensure that both 'checked' and 'value' attributes are updated consist…
Browse files Browse the repository at this point in the history
…ently for client-side rendering. [fixes #33]
  • Loading branch information
kkinder committed Aug 3, 2024
1 parent bca3c49 commit fc9caf9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions puepy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,13 @@ def _render_onto(self, element, attrs):
element.setAttribute("checked", self.origin.state[self.bind])
else:
element.checked = bool(self.origin.state[self.bind])
element.setAttribute("checked", self.origin.state[self.bind])
else:
if is_server_side:
element.setAttribute("value", self.origin.state[self.bind])
else:
element.value = self.origin.state[self.bind]
element.setAttribute("value", self.origin.state[self.bind])

self._add_event_listener(element, "input", self.on_bind_input)
elif self.bind:
Expand Down

0 comments on commit fc9caf9

Please sign in to comment.