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

fix: ensure muted DOM property works correctly in FF #13751

Merged
merged 5 commits into from
Oct 23, 2024
Merged

fix: ensure muted DOM property works correctly in FF #13751

merged 5 commits into from
Oct 23, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Oct 21, 2024

Fixes 1) of #13700. This makes it work like autofocus where we set it as a property after creating the element.

Copy link

changeset-bot bot commented Oct 21, 2024

🦋 Changeset detected

Latest commit: cacd1f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm
Copy link
Member

dummdidumm commented Oct 22, 2024

I think this isn't the right fix - the problem exists for some other attributes, too (for example <video playsinline></video> is also set as a property in Svelte 4).
I believe this hints at a bug deeper down - that attributes aren't consistently set as properties. For example if you do <audio muted={true}></audio> - which should be equivalent to <audio muted></audio> - then you'll have it set as a property. The question is for which attributes this makes a difference - if it's only muted or more.
If it's only muted then this may be correct after all, though I think a function is overkill, we can just output node.muted = ... into the generated code directly.

@trueadm
Copy link
Contributor Author

trueadm commented Oct 22, 2024

playsinline seems to work fine for me. @michelheusschen Do you know of any other attributes that don't work for you in FF?

If it's only muted then this may be correct after all, though I think a function is overkill, we can just output node.muted = ... into the generated code directly.

Good point, change made.

@michelheusschen
Copy link

I'm not aware of any other properties besides muted. The playsinline attribute works fine for me in chrome and is unsupported in firefox: https://caniuse.com/mdn-html_elements_video_playsinline

@benmccann benmccann merged commit 17cb462 into main Oct 23, 2024
7 checks passed
@benmccann benmccann deleted the muted branch October 23, 2024 16:35
@github-actions github-actions bot mentioned this pull request Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants