fix(ssr): translate initial_value/checked/selected to HTML equivalents#5493
Open
costajohnt wants to merge 2 commits into
Open
fix(ssr): translate initial_value/checked/selected to HTML equivalents#5493costajohnt wants to merge 2 commits into
costajohnt wants to merge 2 commits into
Conversation
| } | ||
| } | ||
|
|
||
| let mut dom = VirtualDom::new(app); |
There was a problem hiding this comment.
Extrapolate the function to segment to call the var_func after instantiating
The SSR renderer wrote virtual attributes like `initial_value` literally into the HTML output instead of translating them to their HTML equivalents (`value`, `checked`, `selected`). Add an `ssr_attr_name` translation function that maps these Dioxus-specific props to standard HTML attributes, matching what the client-side interpreter already does in set_attribute.ts. Fixes DioxusLabs#5491
Collapse short assert_eq to single line per rustfmt, and remove needless borrows flagged by clippy::needless_borrow.
9d0741c to
3053e01
Compare
Contributor
Author
|
Just a friendly ping on this one. CI is green and the change should be ready for a maintainer to take a look when there's bandwidth. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssr_attr_name()translation for virtual attributes (initial_value,initial_checked,initial_selected) to their HTML equivalents (value,checked,selected)Why
The SSR renderer writes virtual attributes like
initial_valueliterally into the HTML output (producing<input initial_value="hello">) instead of translating them to standard HTML attributes (<input value="hello">). The client-side interpreter (set_attribute.ts) already handles this mapping correctly, but the SSR path was missing it.Verification
initial_value,initial_checked,initial_selected(static + dynamic)cargo check -p dioxus-ssrcleanFixes #5491