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

Fix quantity selector focus state #2099

Merged
merged 16 commits into from
Nov 3, 2023

Conversation

MewenLeHo
Copy link
Contributor

@MewenLeHo MewenLeHo commented Jun 21, 2023

Related issues

Coming from the separation of old #1949 PR into two distinct, more comprehensible and easier to review/maintain PR.
This PR is coming alongside with the work on the insufficient contrast in form error state (PR #2090) and was needed after the suggestions made by our design team during Spec meeting - June, 13.

Description

When on error and focused, we must keep the wole borders for the input in the middle and for the buttons.
So we must go from this:
old

to this:
new

(same for buttons)

Motivation & Context

Improve a11y and design unity.

Types of change

  • New feature (non-breaking change which adds functionality)

Live previews

Checklist

Contribution

Accessibility

  • My change follows accessibility good practices; I have at least run axe

Design

  • My change respects the design guidelines defined in Orange Design System
  • My change is compatible with responsive display

Development

  • My change follows the developer guide
  • (NA) I have added JavaScript unit tests to cover my changes
  • (NA) I have added SCSS unit tests to cover my changes

Documentation

  • (NA) My change introduces changes to the documentation and/or I have updated the documentation accordingly

Checklist (for Core Team only)

  • (NA) My change introduces changes to the migration guide
  • (NA) My new component is added in Storybook
  • (NA) My new component is compatible with RTL
  • Manually run BrowserStack tests
  • Manually test browser compatibility with BrowserStack (Chrome >= 60, Firefox >= 60 (+ ESR), Edge, Safari >= 12, iOS Safari, Chrome & Firefox on Android)
  • Code review
  • Design review
  • A11y review

After the merge

@netlify
Copy link

netlify bot commented Jun 21, 2023

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit 7320d57
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/6544f795200b6d0008787975
😎 Deploy Preview https://deploy-preview-2099--boosted.netlify.app/docs/5.3/forms/validation
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@julien-deramond

This comment was marked as resolved.

@julien-deramond julien-deramond marked this pull request as draft July 3, 2023 06:50
@MewenLeHo MewenLeHo marked this pull request as ready for review July 25, 2023 07:12
@julien-deramond
Copy link
Member

julien-deramond commented Jul 28, 2023

FYI #2090 is merged, I've rebased this PR. First dev review can be started.

@louismaximepiton

This comment was marked as outdated.

@MewenLeHo

This comment was marked as outdated.

louismaximepiton

This comment was marked as outdated.

@Aniort
Copy link
Contributor

Aniort commented Aug 4, 2023

NICE, ok 👌

Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@Franco-Riccitelli
Copy link

Looks good to me.

@MewenLeHo
Copy link
Contributor Author

MewenLeHo commented Aug 30, 2023

Isn't it possible to have the input square? Right now, it's 42x40 (and 32x30 for the small variant).

Screenshot 2023-08-30 at 07 52 56

In the Dev Tool, just setting a max-width: 40px does the trick, but maybe it's not that simple within the context of everything.

Screenshot 2023-08-30 at 07 55 22

It's possible to keep the center input square at 40*40px.
But I would not recommend to do it using a max-width: 40px rule on it because if you do it the whole component will be smaller than the requested 120px:
qs

I would rather find a way to override this rule for input groups to do it and remove the negative margins to make everything looks perfectly squared:

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: calc(var(--bs-border-width) * -1);
}

=> see commit e1aa6c8

Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

$quantity-selector-sm-width should be 5.625rem (90px) instead of 5.5rem
also if we change $quantity-selector-input-max-width: 2.5rem (2.625rem atm) and $quantity-selector-input-sm-max-width: 1.875rem (2.5rem atm) it could avoid the flex-shrink in the comment below
What would you think about these modifications ?

scss/mixins/_forms.scss Outdated Show resolved Hide resolved
scss/forms/_quantity-selector.scss Outdated Show resolved Hide resolved
@MewenLeHo
Copy link
Contributor Author

$quantity-selector-sm-width should be 5.625rem (90px) instead of 5.5rem also if we change $quantity-selector-input-max-width: 2.5rem (2.625rem atm) and $quantity-selector-input-sm-max-width: 1.875rem (2.5rem atm) it could avoid the flex-shrink in the comment below What would you think about these modifications ?

I just pushed one commit without the .input-group to test it. It looks good to me but I am wondering if breaking change is too much or not... 🤔

(We can just revert the last commit if it's too much)

Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

One more thing and we're GTG.
On the .input-group side, I think it'd be fine since it corrects a small shift we had. Any thoughts @julien-deramond ?

scss/forms/_quantity-selector.scss Show resolved Hide resolved
Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

👌

@julien-deramond

This comment was marked as resolved.

@julien-deramond julien-deramond force-pushed the main-mlh-fix-quantity-selector-focus branch from 7c8ece0 to 4517d1c Compare November 3, 2023 12:19
@julien-deramond
Copy link
Member

julien-deramond commented Nov 3, 2023

After clicking in the area where the value is set to "12", the value is a little bit truncated:
Screenshot 2023-11-03 at 13 47 48

This is probably due to:
Screenshot 2023-11-03 at 13 46 04

IDK if it's possible but might try to have a 20x20 area but reduce the left and right padding

Edit: tried something with a9afefa

@julien-deramond julien-deramond merged commit e09dbc1 into main Nov 3, 2023
14 checks passed
@julien-deramond julien-deramond deleted the main-mlh-fix-quantity-selector-focus branch November 3, 2023 13:40
@julien-deramond julien-deramond mentioned this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants