-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: force scroller update after revealing a date #8217
Conversation
0595c78
to
03dda97
Compare
03dda97
to
f933665
Compare
|
/** | ||
* @param {HTMLElement} root vaadin-date-picker or vaadin-date-picker-overlay-content | ||
*/ | ||
export function getFocusableCell(root) { |
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.
note: Having the focused part doesn't always mean that the cell is actually focused. I decided to split this helper into getFocusableCell
and getFocusedCell
for clarity.
*/ | ||
export async function waitForScrollToFinish(overlayContent) { | ||
export async function waitForScrollToFinish(root) { |
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.
note: I also changed the signature of these methods to allow tests to pass datePicker
instead of datePicker._overlayContent
which slightly more convenient.
Co-authored-by: Sergey Vinogradov <[email protected]>
Co-authored-by: Sergey Vinogradov <[email protected]>
This ticket/PR has been released with Vaadin 24.6.0.beta3 and is also targeting the upcoming stable 24.6.0 version. |
Description
It turns out essential to flush all scroller debouncers before trying to focus any date to ensure the DOM is updated and the date is truly focusable. Previously,
date.focus()
could be called before the scrolled appliedtabindex=0
to the date element, and this led to test failures because not all browsers allow focusing elements withtabindex=-1
.Part of #8187
Type of change