-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Doesn't work with CSSTransitionGroup animations #48
Comments
Do you have a repro? Would useful to debug. |
Run into the same issue. I have a parent container with CSSTransitionGroup using transform: translate3d to animate a page slide in from right. |
@muntamala would be good to have a gh repo I can debug against. |
Having the same issue @muntamala , tested on a local project. The animation becomes 'jittery' when transitioning a component (that contains this Textarea component within) using CSSTransitionGroup. Removing the _resizeComponent() call in componentDidMount solved the issue as @eriklovdahl mentioned. |
Wrapping textarea component with https://github.com/reactjs/react-static-container and setting |
@andreypopp unfortunately wrapping it with the static container doesnt seem to have any effect. While I dont quite understand the intricacies of the problem we know its from the call to _resizeComponent on mount. Could a possible solution be the just pass a prop to which we could disable this initial call to that function (defaults true)? |
@deep-c can you provide a repo or jsfiddle with repro? |
I had similar issue: Textarea occupied all height when its parent was changing size with css transitions. Setting |
@asquet could u share a reproduced issue on something like https://codesandbox.io/ ? I would love to take a quick look on how it is behaving during the transitions. |
I tried to, but could not import react-textarea-autosize properly. Could you make base fiddle that I can extend? |
Heres what Ive managed to put together |
Thanks! I'll definitely look into this when I have some spare time and provide at least explanation why this happens, although hopefully it will be fixable ;) |
Heh, I couldnt resist and had to check this out :D So unfortunately its kinda a non-fixable issue on our side, certainly not in a performant way. This happens because we hook into So really the best shot at it is in fact using the cache property, which is advised anyway - it will skip unnecessary recomputations inside the lib. Ideally somebody could prepare a PR with a documentation note about this. PS. I also really appreciate simpler demo you have put together (without |
@Andarist you beat me to it! Thanks for the example, I looked into it. We schedule a rAF callback with The current implementation only calls So for that exact case my advice above to use See updated codesandbox: https://codesandbox.io/s/1rN0XgGRj (btw love this service!) Why partially? Because if you resize browser window when animation is in progress or textarea is hidden — it trigger Maybe we should add |
hey @andreypopp ! Im glad you are still around and checking out :) skipUpdate |
Hi, What do you think about it? |
If it works then it works 😉be pragmatic - from what I understand you force the rerender in onAnimationEnd, right? Seems that can indeed solve a problem, we just can't do anything like this in the library itself, because it's a leaf node and we can't know in what way it is used. When I have last looked into the code it seemed to me that rAF scheduling might not be needed nowadays (issue #216), maybe it was needed once, but at the moment it's used only for controlled mode (and for uncontrolled mode when props change, but it seems to me that the only relevant part are value changes, so this case in uncontrolled mode can be disregarded). So if we do not have any perf reports for uncontrolled mode, maybe this scheduling used in controlled mode is an overkill and could be just removed? Which has potential of alleviating your issue altogether. Problem with such changes is that we don't really have any tests :s so any change is a risk. I'll try to prepare a beta release without that scheduling in a moment for testing purposes. |
You can try |
Not sure if this will be helpful for others, but I was running into this issue when using Setting the |
I'm using a CSSTransitionGroup to perform a page transition to a page with the textarea-autosize component. The animation won't run if I don't remove the call to _resizeComponent in ComponentDidMount.
Not entirely sure what's causing it yet.
The text was updated successfully, but these errors were encountered: