Skip to content

fix(checkbox): re-evaluate label visibility when label is updated#30980

Merged
OS-jacobbell merged 5 commits intomainfrom
FW-6752
Mar 12, 2026
Merged

fix(checkbox): re-evaluate label visibility when label is updated#30980
OS-jacobbell merged 5 commits intomainfrom
FW-6752

Conversation

@OS-jacobbell
Copy link
Contributor

What is the current behavior?

Checkbox's render function applies the label-text-wrapper-hidden css class when there is no label text to prevent extra margin from being added. The render function is not re-evaluated if the label is updated. This causes a problem in Angular where dynamic variables get applied after the page is loaded, and a checkbox using a variable as a label gets stuck with its label hidden until something else triggers a re-render, e.g. ticking the box.

What is the new behavior?

  • The checkbox will be re-rendered, and css classes will be updated, when the label text is changed.
  • Updated tests to check that the label is visible after changing from blank to having content.

Does this introduce a breaking change?

  • Yes
  • No

@OS-jacobbell OS-jacobbell requested a review from a team as a code owner February 27, 2026 17:19
@OS-jacobbell OS-jacobbell requested a review from ShaneK February 27, 2026 17:19
@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Mar 11, 2026 4:54pm

Request Review

@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package labels Feb 27, 2026
Copy link
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Just a couple of change requests

Copy link
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Great work!

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OS-jacobbell OS-jacobbell added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit ce83407 Mar 12, 2026
106 of 108 checks passed
@OS-jacobbell OS-jacobbell deleted the FW-6752 branch March 12, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants