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

Inconsistent attribute ordering between static/dynamic nodes #4174

Open
Tracked by #2964
nolanlawson opened this issue Apr 25, 2024 · 0 comments
Open
Tracked by #2964

Inconsistent attribute ordering between static/dynamic nodes #4174

nolanlawson opened this issue Apr 25, 2024 · 0 comments
Labels

Comments

@nolanlawson
Copy link
Contributor

nolanlawson commented Apr 25, 2024

Description

Due to the static content optimization, the ordering of attributes in the DOM may be inconsistent.

This is only an issue if you are relying on the iteration order of elm.attributes, or the exact string output of elm.outerHTML, or something like that.

Our Jest serializer also pretty-prints HTML, so the difference is smoothed over in that case.

Related: #4124

Steps to Reproduce

Repro

Static output:

<div data-foo="foo" data-bar="bar" class="clazzy" style="color: blue">yolo</div>

Dynamic output:

<div class="clazzy" style="color: blue" data-foo="foo" data-bar="bar">yolo</div>

Expected Results

The attribute order should be identical.

Actual Results

The attribute order is different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant