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
Help us to manage our issues by answering the following:
1. Describe your issue:
In 3.1.1 there was a change to the way mount is triggered for looped custom child tags.
See this code in the mount function:
// if it's not a child tag we can trigger its mount event
if (!this.parent) {
this.trigger('mount');
}
// otherwise we need to wait that the parent "mount" or "updated" event gets triggered
else {
getImmediateCustomParentTag(this.parent).one(!this.parent.isMounted ? 'mount' : 'updated', function() {
this$1.trigger('mount');
});
}
This causes an issue for some of our code, since you add the listener to the immediateCustomParentTag but the check for which event to listen to (mount or updated) is on this.parent. The check however should be on the immediateCustomParentTag:
// if it's not a child tag we can trigger its mount event
if (!this.parent) {
this.trigger('mount');
}
// otherwise we need to wait that the parent "mount" or "updated" event gets triggered
else {
var immediateCustomParentTag = getImmediateCustomParentTag(this.parent);
immediateCustomParentTag.one(!immediateCustomParentTag.isMounted ? 'mount' : 'updated', function() {
this$1.trigger('mount');
});
}
Without this change, the child tags in my code never trigger a mount, only a before-mount, even though they are on the DOM. I am not sure if this is an adequate fix or if I'm missing the big picture here (maybe this.parent or this.parent.isMounted is incorrect in some cases?), but this seems to fix all my issues and logically makes sense. If I'm right here, I'm glad to make a PR.
TL;DR Code should be listening for updated on the parent to trigger mount on the child, but instead is listening for mount to trigger child mount on an already mounted parent tag, hence never triggering mount on the child.
4. Which version of Riot does it affect?
3.1.1
5. How would you tag this issue?
Question
Bug
Discussion
Feature request
Tip
Enhancement
Performance
The text was updated successfully, but these errors were encountered:
Help us to manage our issues by answering the following:
1. Describe your issue:
In 3.1.1 there was a change to the way
mount
is triggered for looped custom child tags.See this code in the
mount
function:This causes an issue for some of our code, since you add the listener to the
immediateCustomParentTag
but the check for which event to listen to (mount
orupdated
) is onthis.parent
. The check however should be on theimmediateCustomParentTag
:Without this change, the child tags in my code never trigger a
mount
, only abefore-mount
, even though they are on theDOM
. I am not sure if this is an adequate fix or if I'm missing the big picture here (maybethis.parent
orthis.parent.isMounted
is incorrect in some cases?), but this seems to fix all my issues and logically makes sense. If I'm right here, I'm glad to make a PR.TL;DR Code should be listening for
updated
on the parent to triggermount
on the child, but instead is listening formount
to trigger childmount
on an already mounted parent tag, hence never triggeringmount
on the child.4. Which version of Riot does it affect?
5. How would you tag this issue?
The text was updated successfully, but these errors were encountered: