You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there's no distinction between attributes and properties-- attributes are used as attributes in HTML and as properties in the browser. This is necessary for things like "value" to work-- setting the "value" attribute in the browser doesn't change the content, and it's not possible to set properties in HTML AFAIK. However, this causes weirdness for things that have both an attribute and property with different names, such as "class" and "className". Elm special-cases a bunch of these names in order to apply them differently, but that's really messy. Attribute/property keys could be changed to an enum and matched on, but this has the unfortunate side effect of restricting keys to a predefined set, as well as requiring an import for each attribute used.
The text was updated successfully, but these errors were encountered:
After some thought, I'm probably just going to special-case certain strings, ala Elm. It's the easiest on users of the library, and it only imposes a tiny runtime cost (a single match statement).
Currently, there's no distinction between attributes and properties-- attributes are used as attributes in HTML and as properties in the browser. This is necessary for things like "value" to work-- setting the "value" attribute in the browser doesn't change the content, and it's not possible to set properties in HTML AFAIK. However, this causes weirdness for things that have both an attribute and property with different names, such as "class" and "className". Elm special-cases a bunch of these names in order to apply them differently, but that's really messy. Attribute/property keys could be changed to an enum and matched on, but this has the unfortunate side effect of restricting keys to a predefined set, as well as requiring an import for each attribute used.
The text was updated successfully, but these errors were encountered: