-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fixed Date Widget position in rtl #1442
Conversation
f341e74
to
899ab22
Compare
Accessibility Violations Found
|
Accessibility Violations Found
|
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
@@ -606,7 +607,12 @@ if (typeof window.DatePickerWidget === 'undefined') { | |||
this.#dp.style.left = styles.left; | |||
const localeObj = new Intl.Locale(this.#lang); | |||
if(localeObj?.textInfo?.direction == "rtl") { | |||
this.#dp.style.right = styles.left; | |||
let right = windowInnerWidth - (left + inputRect.width); // Calculate right offset | |||
if (right + 433 > windowInnerWidth) { // 433 is the widget's width |
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.
hardcoding the widget's width might not be appropriate across different viewports. Can we calculate the widget's width based on the actual element dimensions.
@@ -606,7 +607,12 @@ if (typeof window.DatePickerWidget === 'undefined') { | |||
this.#dp.style.left = styles.left; | |||
const localeObj = new Intl.Locale(this.#lang); | |||
if(localeObj?.textInfo?.direction == "rtl") { | |||
this.#dp.style.right = styles.left; | |||
let right = windowInnerWidth - (left + inputRect.width); // Calculate right offset | |||
if (right + 433 > windowInnerWidth) { // 433 is the widget's width |
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.
Instead of 433 will this.#dp.offsetWidth work ?
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.
Implemented!
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.
check comments
bdfafde
to
44dbd8c
Compare
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1442 +/- ##
=========================================
Coverage 82.27% 82.27%
Complexity 923 923
=========================================
Files 103 103
Lines 2369 2369
Branches 321 321
=========================================
Hits 1949 1949
Misses 257 257
Partials 163 163 ☔ View full report in Codecov by Sentry. |
@@ -154,7 +154,7 @@ | |||
|
|||
.cmp-adaptiveform-datepicker__calendar-icon { | |||
position: absolute; | |||
top: 50%; | |||
top: 41px; |
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.
This will again cause issues with other viewport ? Have you verified other viewport manually
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.
Checked on different view ports and we have to give top in px only, if given in % icon moves to downside when error appears on the UI because it moves relative to the parent.
@@ -40,6 +40,7 @@ describe("Form Runtime with Date Picker", () => { | |||
// Year should be in Buddhist calendar year for Thai language | |||
it("Test localisation for date picker for Persian", () => { | |||
const [datePicker8, datePicker7FieldView] = Object.entries(formContainer._fields)[8]; | |||
console.log(Object.entries(formContainer._fields)[8], 'form-container'); |
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.
Please remove the log
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.
Removed!
e65d64e
to
4651121
Compare
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: