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(item): matches material design character counter #24335

Merged
merged 5 commits into from
Jan 19, 2022
Merged

Conversation

sean-perkins
Copy link
Contributor

@sean-perkins sean-perkins commented Dec 7, 2021

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)
  • 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 counter implementation for ion-item has a few differences from the MD spec. Also the counter does not consistently display to the right of the container and can run into the helper/error text when long strings are used.

Issue Number: Resolves #24334

What is the new behavior?

  • Updates text color for MD to rgba(0, 0, 0, .6)
  • Updates letter spacing for MD to 0.0333333em
  • Updates left padding from counter to 16px
  • Updates counter string to match MD 5 / 10 instead of 5/10
  • Pushes counter to always display far right of the container

Does this introduce a breaking change?

  • Yes
  • No

Other information

Material Design specification can be found here: https://material.io/components/text-fields

@liamdebeasi liamdebeasi changed the base branch from next to main December 13, 2021 17:20
@sean-perkins sean-perkins marked this pull request as ready for review January 11, 2022 20:08
@sean-perkins sean-perkins requested a review from a team as a code owner January 11, 2022 20:08
Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

These changes look good to me, but would the new shadow parts count as feature updates? 🤔 cc @liamdebeasi

@liamdebeasi
Copy link
Contributor

Yeah this is a feature change, so it would go into the feature-6.1 branch. Can we do a design doc before we merge so we can align on scope and requirements for this feature?

@sean-perkins
Copy link
Contributor Author

Would it be worth splitting out those specific changes (and related issues) and keep this PR targeted on the visual issues with MD?

Happy to create a design doc on the shadow part changes and how they can be used/configured.

@liamdebeasi
Copy link
Contributor

I think so. If we can limit this PR to the fixes noted in the linked issue and address the features for customization in a different PR, that would work with me.

Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

LGTM now 👍 Don't forget to update the PR description too.

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.

bug: Material design implementation for counter display with ion-item
3 participants