Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PuePy should also set checked, style etc for WebComponents #33

Closed
kkinder opened this issue Aug 3, 2024 · 0 comments · Fixed by #34
Closed

PuePy should also set checked, style etc for WebComponents #33

kkinder opened this issue Aug 3, 2024 · 0 comments · Fixed by #34
Assignees
Labels
bug Something isn't working

Comments

@kkinder
Copy link
Owner

kkinder commented Aug 3, 2024

The code in core.py is designed to directly set checked and value as attributes on the value, not via DOM setAttribute. That's how it works with normal HTML elements:

        if self.bind and self.origin:
            if _element_input_type(element) == "checkbox":
                if is_server_side and self.origin.state[self.bind]:
                    element.setAttribute("checked", self.origin.state[self.bind])
                else:
                    element.checked = bool(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]

However, I'm finding this does result in some bug with webcomponents that expect both to be set. So we should set both the .checked value and the .value itself, which shouldn't cause any issues.

@kkinder kkinder added the bug Something isn't working label Aug 3, 2024
@kkinder kkinder self-assigned this Aug 3, 2024
@kkinder kkinder linked a pull request Aug 3, 2024 that will close this issue
@kkinder kkinder closed this as completed in fc9caf9 Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant