-
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
fix!: do not override dir attribute on the overlay to rely on DirMixin #7677
Conversation
Looks like Material theme of the date-picker needs updates, I will look into it. web-components/packages/date-picker/theme/material/vaadin-date-picker-overlay-styles.js Lines 27 to 30 in 881a9f9
|
Quality Gate passedIssues Measures |
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.
LGTM.
However, shouldn't the component propagate its dir to the overlay in general? I expected the overlay to have [dir=rtl]
in this example, but it doesn't, regardless of the PR change:
<vaadin-date-picker label="Start date" dir="rtl"></vaadin-date-picker>
Good point. We have some logic for this in |
This ticket/PR has been released with Vaadin 24.5.0.beta2 and is also targeting the upcoming stable 24.5.0 version. |
Description
Fixes #7676
This removes logic for setting
dir
based oncomputedStyle.direction
- originally this line was added in #2567 when updatingvaadin-date-picker
to usePositionMixin
(previously, date-picker was settingdir
to theinputElement
direction which was introduced long ago in vaadin/vaadin-date-picker#584).Setting
dir
this way is problematic since it overridesdir
attribute propagation from the<html>
element which is performed byDirMixin
. As a result, oncedir
is set toltr
it can't be changed tortl
upon overlay re-opening. In fact, the current tests just don't verify the value of thedir
attribute set on the overlay.This PR removes the line so that we could rely on the
DirMixin
instead, and updates RTL tests accordingly so that we don't close and reopen overlay in these tests and rely ondir
attribute being updated.Note, manual
updatePosition()
is used in the tests to align with other tests below and because the target is absolutely positioned, so it's not moved whendir
updated to RTL (which would generally be the case in the real world apps).Type of change
Note
Marked as behavior altering fix since this change involves removal of
dir='ltr'
set by default from some overlay based components (see snapshots) and in theory some custom styles might rely on it, as did Material theme in 1 place.