fix(CardHeightMatching): Fix debounce invocation in CardHeightMatching - #301
Conversation
Pull Request Test Coverage Report for Build 1128
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1140
💛 - Coveralls |
|
@michaelkro can you confirm? |
|
So the good news is that the error reported in #300 is gone, but the bad news is that now, when navigating away from the Base Card w/HeightMatching story, I'm seeing this error edit: I should note that while I'm seeing this error in our storybook, I have no idea if this will/does happen in a product environment |
|
I noticed that as well. I "think" it is storybook related, but I will track it down as well and see if I can fix it. I am adding tests now so I am not quite finished anyways. |
debounce needs to be passed a function. fix patternfly#300
7fd74ab to
0355594
Compare
| }); | ||
|
|
||
| test('creates a ResizeSensor for each selector', () => { | ||
| mount(<CardHeightMatching {...props} />); |
There was a problem hiding this comment.
mount was used instead of shallow since refs are used inside of the component.
| } | ||
|
|
||
| _matchHeights(selectors = this._selectors) { | ||
| if (!this._container) { |
There was a problem hiding this comment.
just in case...it doesn't hurt...thanks!
There was a problem hiding this comment.
yeah, this was the source of the error @michaelkro mentioned before. Since _matchHeights is called inside of debounce, this can be called after the component has unmounted which will make _container null. I didn't see a good way to cancel the debounced call, unfortunately.
What:
debounce needs to be passed a function.
Link to Storybook:
https://rawgit.com/dmiller9911/patternfly-react/card-height-matching-debounce/index.html
Additional issues:
fix #300