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

bind:offsetWidth not triggering DOM update for element attribute #15168

Open
woodyrew opened this issue Jan 31, 2025 · 3 comments
Open

bind:offsetWidth not triggering DOM update for element attribute #15168

woodyrew opened this issue Jan 31, 2025 · 3 comments

Comments

@woodyrew
Copy link

Describe the bug

Image src attribute not being reflected correctly in the DOM after the offsetWidth has first updates with the container element's width.

Reproduction

Compare console output to image element src attribute. The issue is that the update to src isn't being reflected in the DOM.

Image component should load an image with the correct intrinsic size.

https://svelte.dev/playground/0e74d58db919472f97aa1954558d3242?version=5.19.6

Logs

System Info

Browsers  System:
    OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
    Memory: 35.28 GB / 62.52 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.18.2 - ~/.nvm/versions/node/v20.18.2/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.2/bin/npm
    pnpm: 9.15.4 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 132.0.6834.159
    Chromium: 132.0.6834.83
    Firefox: 134.0.2 (64-bit)

Severity

annoyance

@7nik
Copy link
Contributor

7nik commented Jan 31, 2025

No, this is only related to lazy loading and changing the src right after mounting. REPL.

There is PR #15141 related to this bug, though it isn't fixed there. @paoloricciuti

@paoloricciuti
Copy link
Member

No, this is only related to lazy loading and changing the src right after mounting. REPL.

There is PR #15141 related to this bug, though it isn't fixed there. @paoloricciuti

Yeah I think we will close that PR and switch to use importNode on Firefox so we don't have to use this trick anymore

@woodyrew
Copy link
Author

woodyrew commented Feb 3, 2025

Thanks for the context. Should I:
A) Update the title of this issue? "Lazyloaded src not updating correclty after mounting"
B) Close the issue?
C) Leave it in your hands to update or close as you see fit?

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

3 participants