Skip to content

fix(select): add icon-inner & placeholder part - #20605

Merged
brandyscarney merged 3 commits into
masterfrom
fix-select-parts
Feb 26, 2020
Merged

brandyscarney merged 3 commits into
masterfrom
fix-select-parts

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Feb 24, 2020 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
@kawazoe kawazoe mentioned this pull request Aug 18, 2020
6 of 7 tasks
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