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
As of right now, nested ScrollAnimationParent and their ScrollAnimationChild components are not scoped correctly, as the root parent always controls all the children.
We could use the same logic as in the Menu component in order to separate the nested parents' scopes, but that would mean that scopes would always be separated. A better fix would be to add a name option to the components, so the parent could filter its children before triggering their scrolledInView method.
import{ScrollAnimationParentasScrollAnimationParentCore,ScrollAnimationChildasScrollAnimationChildCore}from'@studiometa/ui';classScrollAnimationChildextendsScrollAnimationChildCore{staticconfig={options: {group: String,},};}exportdefaultclassScrollAnimationParentextendsScrollAnimationParent{staticconfig={options: {group: String,},components: {
ScrollAnimationChild,},};scrolledInView(props){const{ group }=this.$options;this.$children.ScrollAnimationChild.filter((child)=>child.$options.group===group).forEach((child)=>child.scrolledInView(props));}}
The text was updated successfully, but these errors were encountered:
Issue
As of right now, nested
ScrollAnimationParent
and theirScrollAnimationChild
components are not scoped correctly, as the root parent always controls all the children.We should be able to have the following child-parent relation:
Current workaround
This can be done now by extending the
ScrollAnimationParent
in order for it to have a different name, but this is not ideal.Suggested fix
We could use the same logic as in the
Menu
component in order to separate the nested parents' scopes, but that would mean that scopes would always be separated. A better fix would be to add a name option to the components, so the parent could filter its children before triggering theirscrolledInView
method.The text was updated successfully, but these errors were encountered: