-
Notifications
You must be signed in to change notification settings - Fork 778
Description
Hello,
I am using Hyperapp with various libraries of web components, some of which require particular classes to be dynamically added to trigger specific behaviors. It seems to me that when Hyperapp patches the class property, it completely overwrites the existing classes on the node, including the classes those web components set for their internal behavior. Is it possible that the diff is performed on just the classes that Hyperapp "owns", just like it does for 'style'?
I believe this was touched upon before here #1078 and I understand that Hyperapp needs complete control over the DOM. While I agree this should be the ideal case, in practice the class list is a bit of a recurrent problem, as large libraries seem to (still) be using dynamic classes as user-facing properties.
Just to clarify, this refers to third party web components that Hyperapp otherwise handles quite nicely. The issue is not in other scripts messing with the DOM tree of Hyperapp itself, it's in using
h("third-party-web-component", { class: { customClass: true} })where third-party-web-component already has some implicit predefined classes.
From my limited understanding of Hyperapp's internals I presume this is not possible when class is specified as a string, but could probably work with array and object, which would be just fine to use.