-
Notifications
You must be signed in to change notification settings - Fork 649
Ensure only the *-enter-done and *-exit-done classes should exist tested DOM node when config.disabled is set to true #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
*-enter-done
and *-exit-done
classes should exist tested DOM node when config.disabled
is set totrue
*-enter-done
and *-exit-done
classes should exist tested DOM node when config.disabled
is set totrue
This doesn't actually fix #341, though, does it? That one doesn't just cover cases with |
@taion No it doesn't fix that issue, It does relate to it though. However, it does fix the issue I was having (and feel that should be fixed in the codebase) with both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. This seems somewhat insufficient, though. Among other things we're not removing appear
. And it'd be straightforward to deal with the case when exit
is set to false.
Given that, I think it'd make the most sense to just unconditionally remove those classes...
Alternatively, maybe <Transition>
can always call onExit
.
@jquense thoughts?
this.addClass(node, type, 'done'); | ||
|
||
if (config.disabled) { | ||
this.removeClasses(node, 'exit'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onEntered = (node, appearing) => {
this.removeClasses(node, 'exit');
const type = appearing ? 'appear' : 'enter'
this.removeClasses(node, type);
this.addClass(node, type, 'done');
if (this.props.onEntered) {
this.props.onEntered(node, appearing)
}
}
this.addClass(node, 'exit', 'done'); | ||
|
||
if (config.disabled) { | ||
this.removeClasses(node, 'enter'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onExited = (node) => {
this.removeClasses(node, 'enter');
this.removeClasses(node, 'appear');
this.removeClasses(node, 'exit');
this.addClass(node, 'exit', 'done');
if (this.props.onExited) {
this.props.onExited(node)
}
}
@taion @karlwills We're running into this issue as well. Are there any blockers to @taion 's suggested fixes? I can try and take over the PR if you guys need some more resources on this |
This pull request relates to #341 and ensures that only the
*-enter-done
and*-exit-done
classes should exist on the tested DOM node whenconfig.disabled
is set totrue
Credit goes to @joefurniss for spotting this issue.
Testing Components with Transitions
https://reactcommunity.org/react-transition-group/testing/