Skip to content
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

Align dir attribute usage on the overlays with the host element #7681

Open
web-padawan opened this issue Aug 21, 2024 · 0 comments
Open

Align dir attribute usage on the overlays with the host element #7681

web-padawan opened this issue Aug 21, 2024 · 0 comments
Labels
bug Something isn't working Impact: Low RTL Right-to-left issue Severity: Minor vaadin-overlay

Comments

@web-padawan
Copy link
Member

Description

Currently, components like vaadin-date-picker-overlay do not respect custom dir set on the host element.
The only case that supports this is vaadin-combo-box-overlay that uses custom logic for this:

const comboBox = this._comboBox;
const hostDir = comboBox && comboBox.getAttribute('dir');
if (hostDir) {
this.setAttribute('dir', hostDir);
}

Note: prior to #7677 the dir was set based on getComputedStyle(this).direction. This logic is now removed to enable using globally set dir attribute value on overlay based components. But we probably should also check host dir.

Expected outcome

Expected the dir='rtl' to be set on the overlay when provided on the host element by components such as:

  • vaadin-date-picker
  • vaadni-select
  • vaadin-menu-bar

Note: the vaadin-time-picker is a special case since it enforces dir='ltr' on the overlay by design.

Minimal reproducible example

<vaadin-date-picker label="Start date" dir="rtl"></vaadin-date-picker>

Steps to reproduce

  1. Add the snippet above to the HTML page
  2. Open the date-picker overlay
  3. Check the overlay dir in dev tools

Environment

Vaadin version(s): 24.x, also earlier versions

Browsers

Issue is not browser related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Impact: Low RTL Right-to-left issue Severity: Minor vaadin-overlay
Projects
None yet
Development

No branches or pull requests

2 participants