Skip to content

fix(select): adjust label alignment when in a card - #27202

Merged
liamdebeasi merged 10 commits into
mainfrom
FW-3913
Apr 20, 2023
Merged

liamdebeasi merged 10 commits into
mainfrom
FW-3913

Conversation

@mapsandapps

@mapsandapps mapsandapps commented Apr 13, 2023 •

Copy link
Copy Markdown
Contributor

Issue URL: resolves #27086


What is the current behavior?

When an ion-select is inside a card, the label is slightly lower than it should be, making it out of alignment with the label of an ion-input.

What is the new behavior?

  • When inside a card, the labels of ion-input and ion-select are in line with each other.

Does this introduce a breaking change?

  • Yes
  • No

Other information

This bug was occurring because the label of ion-select is in the shadow DOM. As recommended, this fix was also added to ion-input and ion-textarea in case those labels are also later moved to the shadow DOM.

Before:
Screenshot 2023-04-13 at 4 35 44 PM

After:
Screenshot 2023-04-13 at 4 36 02 PM

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions Bot added the package: core @ionic/core package label Apr 13, 2023
@mapsandapps
mapsandapps marked this pull request as ready for review April 14, 2023 14:11
@mapsandapps
mapsandapps requested a review from a team as a code owner April 14, 2023 14:11

@sean-perkins sean-perkins left a comment

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.

Can we add screenshot tests for the select being rendered in a card, so that it doesn't regress in the future?

@mapsandapps
mapsandapps marked this pull request as draft April 19, 2023 14:28
@mapsandapps
mapsandapps marked this pull request as ready for review April 19, 2023 19:37
await page.setContent(`
<ion-card>
<ion-card-content>
<ion-item style="border: 1px solid grey; margin: 16px">

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.

Is the border for a visual reference for the label alignment? If so, what is the margin: 16px for?

~ Nit: Can we add lines="none" to the ion-item if we are going to draw a border around the container? Currently there are two bottom border lines.

@liamdebeasi liamdebeasi left a comment

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.

+1 to Sean's comments, but otherwise looks good.

@mapsandapps
mapsandapps added this pull request to the merge queue Apr 20, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 20, 2023
@liamdebeasi
liamdebeasi added this pull request to the merge queue Apr 20, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 20, 2023
@liamdebeasi
liamdebeasi added this pull request to the merge queue Apr 20, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 20, 2023
@liamdebeasi
liamdebeasi added this pull request to the merge queue Apr 20, 2023
Merged via the queue into main with commit 5a2b87c Apr 20, 2023
@liamdebeasi
liamdebeasi deleted the FW-3913 branch April 20, 2023 18:16
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: Label not aligned properly between ion input and ion select when in card component

4 participants