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

Reference to sprite lost in dynamic usage #194

Closed
hrvstr opened this issue Jan 20, 2024 · 0 comments · Fixed by #200
Closed

Reference to sprite lost in dynamic usage #194

hrvstr opened this issue Jan 20, 2024 · 0 comments · Fixed by #200

Comments

@hrvstr
Copy link

hrvstr commented Jan 20, 2024

What version of astro-icon are you using?

1.0.2

Astro Info

Astro                    v4.2.1
Node                     v21.5.0
System                   macOS (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             astro-icon
                         @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

Chrome, Firefox and Safari

Describe the Bug

Removing the first instance of an icon from the DOM breaks all other instances on the page because the reference is lost.

Please provide a prob to disable sprite behavior for dynamic usage.

Original discord thread for reference:
https://discord.com/channels/830184174198718474/1197851914784755733

Seems like the new method for sprites doesn’t work with dynamic usage like this because it loses the reference to the original sprite.

I can also look into providing a prop that disables this sprite behavior

Demo: https://golden-naiad-6e9246.netlify.app/

What's the expected result?

Removing an instance shouldn't break other icons.

Link to Minimal Reproducible Example

https://github.com/hrvstr/astro-icon-list

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 a pull request may close this issue.

1 participant