[RFC] Custom element bindables take priority over custom attribute #1896
Labels
RFC
Request For Comment - Potential enhancement that needs discussion and/or requires experimentation
Milestone
🔦 Context
Suppose we have a global custom attribute
size
, and a custom element<square>
with a bindablesize
property, and the following template:Currently, in both v1 and v2,
size.bind
is understood as custom attributesize
and thus the propertysize
on the custom element<square>
will be ignored. This will also lead to a different behavior when used in spreading...$attrs
.This order of custom attribute taking over custom element bindable is not intuitive as it allows any arbitrary global custom attribute to override local element without anyway to overcome it, especially when consuming a 3rd party plugin. It also doesn't reflect common expectation of local first behavior.
In v2, we should change it so that custom element bindable will be of higher priority than custom attribute.
❔ Migration
Migration shouldn't be a big issue since it's unlikely that app will keep the conflict around.
cc @Sayan751 @fkleuver
The text was updated successfully, but these errors were encountered: