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

vnode's className is mixed when an empty object is shared as attrs of vnodes. #2821

Closed
kfule opened this issue Feb 12, 2023 · 1 comment
Closed
Assignees
Labels
Type: Bug For bugs and any other unexpected breakage

Comments

@kfule
Copy link
Contributor

kfule commented Feb 12, 2023

Mithril.js version:2.2.3

Browser and OS:

Code

https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvEAXwvW10QICsEqdBk2J4hcYgAI4hDACcYAEwCiWAA7EAngEFixOXEkBeScFYAdNJfFSMxyVgAUAcnwZnFabIUr1W3fpwAJTW9BKSAEb2Tq4RHl7ySqoaOnoGIVZoAPRZkW5pcPjUUBhwcAByXF60AK5QipEwkuYgES0A-KFocLSw+FC0AOaOEfmBRSVllTgZlCBwMLDUxBBheACsiADM62wcIJg4eEVlc0KMzDxsALpUUBBoANYIKJxHPFgQxIRy0AACACZ8ECtnManJyDwSMQ1HBEDkamg1I9BkVaFgsp9vr8oIDgfgtpivj9oPhPmh8Pw5lo1Nx5tRfhobqwgA

Steps to Reproduce

  1. define empty object
  2. share 1's empty object for attrs of multiple hyperscripts with selector having class name

Expected Behavior

The vnode class name will be the one defined in the respective selector.

Current Behavior

The class names defined in the selector of each vnode are mixed.

Context

I discovered this in the process of creating the following pr.
#2819

@kfule kfule added the Type: Bug For bugs and any other unexpected breakage label Feb 12, 2023
@pygy
Copy link
Member

pygy commented Feb 12, 2023

Great catch! I thought we were doing that safely :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug For bugs and any other unexpected breakage
Projects
None yet
Development

No branches or pull requests

3 participants