Skip to content

fix(inputs): remove invalid legacy warnings in input, textarea, and select - #28484

Merged
brandyscarney merged 1 commit into
mainfrom
fix-slotted-labels
Nov 7, 2023
Merged

fix(inputs): remove invalid legacy warnings in input, textarea, and select#28484
brandyscarney merged 1 commit into
mainfrom
fix-slotted-labels

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Nov 7, 2023

Copy link
Copy Markdown
Member

Issue number: N/A


What is the current behavior?

When using an ion-label as a label slot inside of an ion-input, ion-textarea or ion-select it erroneously flags the input as a legacy component and ignores the label-placement:

Code Result
<ion-item>
  <ion-input label-placement="floating">
    <ion-label slot="label">
      <ion-icon name="home"></ion-icon>
      Slotted Label
    </ion-label>
  </ion-input>
</ion-item>
<ion-item>
  <ion-input label-placement="floating" value="Value">
    <ion-label slot="label">
      <ion-icon name="person"></ion-icon>
      Slotted Label
    </ion-label>
  </ion-input>
</ion-item>
      
Screenshot 2023-11-07 at 10 37 43 AM

What is the new behavior?

Adds ion-input, ion-textarea, and ion-select as components that can contain a named label slot so it no longer assumes that they are legacy components.

Code Result
<ion-item>
  <ion-input label-placement="floating">
    <ion-label slot="label">
      <ion-icon name="home"></ion-icon>
      Slotted Label
    </ion-label>
  </ion-input>
</ion-item>
<ion-item>
  <ion-input label-placement="floating" value="Value">
    <ion-label slot="label">
      <ion-icon name="person"></ion-icon>
      Slotted Label
    </ion-label>
  </ion-input>
</ion-item>
      

Does this introduce a breaking change?

  • Yes
  • No

@github-actions github-actions Bot added the package: core @ionic/core package label Nov 7, 2023
@brandyscarney
brandyscarney requested review from a team and liamdebeasi and removed request for a team November 7, 2023 16:20
@brandyscarney
brandyscarney marked this pull request as ready for review November 7, 2023 16:21

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

Fix looks good. I'd change the commit message to say "warning" instead of "error" since we're using console.warn

@brandyscarney brandyscarney changed the title fix(inputs): remove invalid legacy errors in input, textarea, and select fix(inputs): remove invalid legacy warnings in input, textarea, and select Nov 7, 2023
@brandyscarney
brandyscarney added this pull request to the merge queue Nov 7, 2023
Merged via the queue into main with commit c765dcb Nov 7, 2023
@brandyscarney
brandyscarney deleted the fix-slotted-labels branch November 7, 2023 17:36
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