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

Fixed Date Widget position in rtl #1442

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Fixed Date Widget position in rtl #1442

merged 1 commit into from
Oct 17, 2024

Conversation

pavi41
Copy link
Contributor

@pavi41 pavi41 commented Oct 15, 2024

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 95 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@@ -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
Copy link
Collaborator

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
Copy link
Collaborator

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented!

Copy link
Collaborator

@rismehta rismehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check comments

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 95 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.27%. Comparing base (e185052) to head (4651121).
Report is 1 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

@@ -154,7 +154,7 @@

.cmp-adaptiveform-datepicker__calendar-icon {
position: absolute;
top: 50%;
top: 41px;
Copy link
Collaborator

@rismehta rismehta Oct 16, 2024

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

Copy link
Contributor Author

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');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed!

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@rismehta rismehta merged commit 3ac02d4 into dev Oct 17, 2024
10 checks passed
@rismehta rismehta deleted the FORMS-14749 branch October 17, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants