-
Notifications
You must be signed in to change notification settings - Fork 83
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
[date-picker] Month duplication caused by font size #1665
Comments
Very weird, but I can confirm. It can be reproduced at https://cdn.vaadin.com/vaadin-date-picker/4.1.1/demo/#date-picker-basic-demos by setting that style on the e.g. document.documentElement.style.setProperty('--lumo-font-size-xs', '0.975rem'); I also noticed that both August and October are duplicated (on this year when testing now), but if you scroll down past them and then when you scroll back up there is only one of them. And again if you scroll up past them a few months and then back down, then they are again duplicated. If you select a value in those months and then open the picker again, then they don't seem duplicated. |
I can confirm that month duplication is still present in version 14.4.10. It can be easy reproduced just by opening: Or, by setting font size in application code: Font size of 16px works ok, but font size 15px duplicates "January". |
I've noticed that month duplication is still present in version 23. On https://vaadin.com/components/vaadin-date-picker/java-examples page I got "May" and "July" duplicated by setting font size to 15px. |
When using the following CSS the issue is reproducible in Vaadin 23.5, but not in Vaadin 24.5.
|
The issue appears to be caused by incorrect initial index calculated in this line:
By default it returns
IMO we should use
UPD: changing it doesn't entirely fix the problem for me since duplicate "March 2025" goes away but there's also duplicate "May 2025" which is caused by |
Could there be an error in the calculation caused by conversion of web-components/packages/date-picker/src/vaadin-infinite-scroller.js Lines 134 to 138 in 5eaff4d
|
The same can be generally achieved also with fractional |
Description
I have a DatePicker and when I scroll down in it the same month appears twice within the same year. The duplicated month is the 3rd and 4th after the initial. The error occures, when the
--lumo-font-size-xs
CSS property is set to0.982rem
or smaller (0.983rem
works fine).Expected outcome
Every month appears once within the same year.
Actual outcome
The 3rd and 4th month after the initial is the same (duplicated) within the same year.
See example video below.
Example
CSS:
Java code:
Vaadin version
Both 14.1.4 and 14.1.27.
Browsers Affected
The text was updated successfully, but these errors were encountered: