Skip to content

fix(input): update disabled opacity of md input - #26514

Merged
sean-perkins merged 13 commits into
feature-7.0from
fix/input-disabled-opacity
Feb 2, 2023
Merged

sean-perkins merged 13 commits into
feature-7.0from
fix/input-disabled-opacity

Conversation

@sean-perkins

@sean-perkins sean-perkins commented Dec 19, 2022 •

Copy link
Copy Markdown
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

The disabled opacity for the label and input is 0.4 for MD.

Issue URL: N/A

What is the new behavior?

  • The disabled opacity for the label and input is 0.37 for MD (aligning with MD spec).

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions Bot added the package: core @ionic/core package label Dec 19, 2022
@sean-perkins
sean-perkins marked this pull request as ready for review January 10, 2023 19:14
@sean-perkins
sean-perkins requested a review from a team as a code owner January 10, 2023 19:14
Comment thread core/src/components/input/input.scss Outdated
:host(.legacy-input) .native-input[disabled],
:host([disabled]) {
opacity: 0.4;
opacity: #{$input-disabled-opacity};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to make this change for ion-textarea?

@sean-perkins sean-perkins Jan 10, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes 🙂 that is part of my v7 changes (active work), so you'll see a separate PR to track that change.

Edit:

I wanted to make sure we approved of this change/approach/etc. for input before tackling it for textarea.

/// This value comes from the Material Design spec:
/// - https://github.com/material-components/material-web/pull/549
/// We apply the same value to both iOS and MD themes.
$input-disabled-opacity: 0.37 !default;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm fine with converging on one opacity. The difference between 0.4 and 0.37 is so small that it likely will not have a noticeable impact on apps. However, the only reason I decided to converge on $input-floating-label-scale for both iOS and MD is that iOS has no concept of a floating label, so we are free to pick a reasonable default. This is not the case with a disabled text field as this pattern appears on iOS. I'd prefer we only converge on patterns when no pattern exists for a certain platform and we need to create one.

@sean-perkins sean-perkins changed the title fix(input): update disabled opacity of input fix(input): update disabled opacity of md input Feb 2, 2023
@sean-perkins

Copy link
Copy Markdown
Contributor Author

Updated this PR so that it only changes the disabled opacity for MD and leaves iOS as it is today. This allows us to match the MD spec without forcing the MD standard on the iOS appearance.

@sean-perkins
sean-perkins merged commit 90f4995 into feature-7.0 Feb 2, 2023
@sean-perkins
sean-perkins deleted the fix/input-disabled-opacity branch February 2, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants