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(select): add icon-inner & placeholder part #20605

Merged
merged 3 commits into from
Feb 26, 2020
Merged

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Feb 24, 2020

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?

This can be considered a feature or a fix, due to the fact it adds a new part, but we haven't documented any of these yet so I'm not sure which way to lean here.

You cannot change the opacity of the select icon or target the placeholder color with the current parts.

Placeholder - Due to the fact that the placeholder and value share the same div, you would have to be able to target it based on the select-placeholder class which does not work with parts.

Select Icon - The opacity was set on the inner icon, so you can change the color using ::part(icon) but it will still have the default .33 opacity. I added a part for icon-inner since that is where the actual arrow is created, and also moved opacity so it is set on the parent wrapper which fixes this problem.

Issue Number: #17248

What is the new behavior?

  • adds icon-inner and placeholder parts
  • adds custom test for styling the select parts
  • remove opacity in icon-inner and set it on the icon wrapper
  • align items center (vertically) - this makes alignment look nicer especially when font size changes

Does this introduce a breaking change?

  • Yes
  • No

Other information

- adds custom test for styling the select parts
- inherit opacity in icon-inner
@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Feb 24, 2020
@brandyscarney
Copy link
Member Author

@liamdebeasi Let me know your thoughts on this implementation

this makes select align better with the icon when used standalone and changing the font size
@brandyscarney brandyscarney merged commit 926ac3f into master Feb 26, 2020
@liamdebeasi liamdebeasi deleted the fix-select-parts branch February 26, 2020 17:09
@liamdebeasi liamdebeasi restored the fix-select-parts branch February 26, 2020 17:09
@liamdebeasi liamdebeasi deleted the fix-select-parts branch February 26, 2020 17:09
@liamdebeasi liamdebeasi restored the fix-select-parts branch February 26, 2020 17:09
@brandyscarney brandyscarney deleted the fix-select-parts branch February 26, 2020 17:09
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.

2 participants