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

audio: muted property not updating without bind:muted #15286

Open
f1nzer opened this issue Feb 13, 2025 · 1 comment
Open

audio: muted property not updating without bind:muted #15286

f1nzer opened this issue Feb 13, 2025 · 1 comment

Comments

@f1nzer
Copy link

f1nzer commented Feb 13, 2025

Describe the bug

Setting muted={muted} on <audio> in Svelte 5.20 does not update the property when muted changes, but bind:muted={muted} works as expected. But it worked in Svelte 4.

Expected behavior: clicking the button should toggle the muted property on the audio as it did in Svelte 4
Actual behavior: muted does not update unless using bind:muted={muted}

Reproduction

Svelte 5.20 playground

Svelte 4.2.19 playground

Logs

System Info

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 241.31 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.3.0 - /opt/homebrew/bin/node
    npm: 10.9.0 - /opt/homebrew/bin/npm
    pnpm: 10.3.0 - ~/Library/pnpm/pnpm
    bun: 1.1.21 - ~/.bun/bin/bun
  Browsers:
    Safari: 18.2

Chrome Version 132.0.6834.160 (Official Build) (arm64)

Severity

annoyance

@adiguba
Copy link
Contributor

adiguba commented Feb 13, 2025

Hello,

I think it's come from #13751 and theses lines :

// Special case for Firefox who needs it set as a property in order to work
if (name === 'muted') {
state.init.push(b.stmt(b.assignment('=', b.member(node_id, b.id('muted')), value)));
return false;
}

The code is added on the "init" state of the component, but since the variable is reactive, this should be done on the "update" state.
Strangely, if I delete these lines it seems to work fine...

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

No branches or pull requests

2 participants