-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[BUG] - Date Picker Showing Wrong Year #3785
Comments
I was also getting this error on the console at the time:
|
Hey, i would like to work on this issue. |
@subhamengine go ahead |
sure. How can I reproduce it? |
This comment was marked as resolved.
This comment was marked as resolved.
The only concrete thing I've determined, is that the set syncing between the month/year picker and main view is off-by-one, and glitches every time it is shown/hidden. bad.calendar.mp4 |
Here is a code sandbox minimum project though. The tailwind is via CDN, because Tailwind -/-> codesandbox, but the behaviour is the same: |
Two hours of breakpoint stepping later, and I believe I have the solution. Correct me if I've misunderstood any of this code. This function is doing the actual data updating, by checking which div intersects the little grey highlight bar:
It loops through the items in ascending order, and stops when it finds the intersecting div...
...Except when it doesn't. because the previous div is able to slightly overlap with the highlight as well. At 125% zoom on my PC, the bug goes away. Only at that zoom setting though. The rest of the time it's broken.
Having stopped one element too early, the focusedDate is set to the wrong value.
My proposal: Delete both these functions:
Update the data directly, when we already had the exact UI element that the user interacted with, which has the relevant data bound to it
|
Thanks. Did you need any further action from me now on this issue?
…On Wed, 25 Sept 2024, 12:56 աӄա, ***@***.***> wrote:
Assigned #3785 <#3785> to
@buchananwill <https://github.com/buchananwill>.
—
Reply to this email directly, view it on GitHub
<#3785 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBL2M6LWWJJTGQVMQ2IQ3LDZYKQFZAVCNFSM6AAAAABOQ5YFZSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGM4TOOBWGIYDMNY>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Hi. Any updates on this issue and when can we expect the fixes to be live? |
I authored a fix and finished working on it two weeks ago. As far as I was able to assess, all the behaviours are now working correctly in that PR. I haven't had any further feedback from @wingkwong or @ryo-manba since then. They may be able to answer when it might be included in a public release. |
@buchananwill |
NextUI Version
2.4.6
Describe the bug
Speaks for itself really... 1987 is in the scroller, but 1986 in the focus. Which is it going to pick? Not clear...
A few scrolls later and this even more confusing collection of conflicts appears:
This was my code (using react-hook-form):
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Use the date picker in a component. Could it be related to using a controlled value?
Expected behavior
I would expect the highlighted, focused and selected values to all be in agreement.
Screenshots or Videos
No response
Operating System Version
Browser
Chrome
The text was updated successfully, but these errors were encountered: