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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v4][Collapsible] Remove componentWillReceiveProp from Collapsible #1670
Conversation
5aae08d
to
388f676
Compare
@@ -5,18 +5,6 @@ import Collapsible from '../Collapsible'; | |||
describe('<Collapsible />', () => { | |||
const ariaHiddenSelector = '[aria-hidden=true]'; | |||
|
|||
it('does not render its children and indicates hidden with aria-hidden', () => { |
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.
We keep the collapsed content in the DOM now for our animation. Does one see a problem with that?
Aww yiss. Not checked the code but this is a fantastic milestone! Let's configure our |
It actually slows it down, which is want we want. Just so that it doesn't play out really fast to reach the desired height in the same amount of time. |
Looks good! I don't see an issue with simply hiding the content given the nature of this component, but when we are ready we should definitely test out instances of it in web. |
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.
This looks good to me, 馃帺 in firefox.
One minor problem I have with will-change
is that is should be added and removed.
...if an element will change when it is clicked, then setting up will-change when that element is hovered gives the browser enough time to optimize for that change
We could add will-change
to the collapsible container when hovering on the button.
The optimizations that the browser makes for changes that are about to occur are usually costly and, as we mentioned earlier, can take up much of the machine鈥檚 resources. The usual browser behavior for optimizations that it makes is to remove these optimizations and revert back to normal behavior as soon as it can. However, will-change overrides this behavior maintaining the optimizations for much longer than the browser would otherwise do.
As such, you should always remember to remove will-change after the element is done changing, so the browser can recover whatever resources the optimizations are claiming.
We could remove will-change
when the transition is done.
Haven't been able to test it yet, but love the dynamic approach! |
e0e2485
to
3939f62
Compare
Going to merge this in without the animation improvements and handle those in a follow-up |
WHY are these changes introduced?
Final fix in ##519 馃帀
WHAT is this pull request doing?
@dleroux and I
componentWillReceiveProps
/ make collapsible a functional componentHow to 馃帺