Skip to content

fix(item): allow item to grow when it is used in a flex container - #28594

Merged
brandyscarney merged 8 commits into
feature-7.6from
bc/fix-select-collapsing
Nov 29, 2023
Merged

fix(item): allow item to grow when it is used in a flex container#28594
brandyscarney merged 8 commits into
feature-7.6from
bc/fix-select-collapsing

Conversation

@brandyscarney

Copy link
Copy Markdown
Member

Issue number: N/A


What is the current behavior?

When an item containing a select is used inside of a flex container, the item collapses to 0px width. Example code:

<div style="display: flex">
  <ion-item>
    <ion-select aria-label="fruit" placeholder="Select fruit">
      <ion-select-option value="apples">Apples</ion-select-option>
      <ion-select-option value="oranges">Oranges</ion-select-option>
      <ion-select-option value="bananas">Bananas</ion-select-option>
    </ion-select>
  </ion-item>
</div>

Note

This bug was introduced in feature-7.6 by this commit. It cannot be reproduced on main.

What is the new behavior?

Sets the flex property to 1 on ion-item so that it will grow inside of a flex container, resulting in the select being displayed. This property is ignored when inside of a block container.

Does this introduce a breaking change?

  • Yes
  • No

Other information

feature-7.6 branch
feature-7 6 branch

@github-actions github-actions Bot added the package: core @ionic/core package label Nov 28, 2023
@brandyscarney brandyscarney changed the title Bc/fix select collapsing fix(item): allow item to grow when it is used in a flex element Nov 28, 2023
@brandyscarney brandyscarney changed the title fix(item): allow item to grow when it is used in a flex element fix(item): allow item to grow when it is used in a flex container Nov 28, 2023
@brandyscarney
brandyscarney marked this pull request as ready for review November 28, 2023 21:06
@brandyscarney
brandyscarney requested review from a team and sean-perkins and removed request for a team November 28, 2023 21:06

@averyrousseau averyrousseau 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.

Fix looks good. Should we add a test for this?

@brandyscarney

Copy link
Copy Markdown
Member Author

I meant to add that in the description - I can add a test if we want one. Should it go in item?

@averyrousseau

Copy link
Copy Markdown
Contributor

Is there a way to show the change in behavior without ion-select? If not, I think it should go in select, but I could be convinced either way 🤷

@brandyscarney

Copy link
Copy Markdown
Member Author

Yeah I couldn't reproduce it outside of select so I added it to the select tests here: 6d0d490

Running screenshots now.

@liamdebeasi

Copy link
Copy Markdown
Contributor

Removing myself from review since there are two approvals already. Lmk if you would still like me to look though!

@liamdebeasi
liamdebeasi removed their request for review November 29, 2023 14:27
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.

5 participants