-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Last item not fully visible when scrolling in time when using portalId in scrollable div #4290
Last item not fully visible when scrolling in time when using portalId in scrollable div #4290
Comments
Hi @1Jesper1 , Is there any case in which the last item is getting hidden? Because I tried with the code you shared and I can't able to reproduce it |
@balajis-qb
|
Yeah, I got the issue. Initially I misunderstood the issue. You are mentioning about the initial view right? when we open the date picker with the last time item as selected, in that case we have to manually scroll to the selected time. Yes I got the issue, I can also reproduce it. Will work on it |
This commit addresses an issue where the scroll position was not accurately set when the component mounted. To resolve this, we have incorporated the use of requestAnimationFrame to delay the scroll update until after the component has fully rendered and layout calculations are complete. This ensures consistent and precise scroll behavior. Closes Hacker0x01#4290
In the time component, the scroll position is set using requestAnimationFrame. To ensure the accurate testing, this commit updates the test case to use waitFor from React Testing Library, allowing the test to wait for the scroll update to complete before making assertions about the scroll position. The test now provides more reliable results and ensures that the scroll behavior is properly tested. Closes Hacker0x01#4290
…Frame In the Time component, this commit refactors the code to ensure that the component ref is available when used inside a requestAnimationFrame callback. By checking the ref availability, the issue of rendering failures is resolved, particularly during testing with asynchronous behavior. Closes Hacker0x01#4290
Thanks for the fast fix for both issues. PR is detailed! |
Describe the bug
Last item not fully visible when scrolling in time when using portalId in scrollable div
To Reproduce
Expected behavior
Should show the full height of last time item.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: