Skip to content

fix(material/form-field): hiding a label after it has been shown leaves a blank space#29461

Merged
crisbeto merged 1 commit intoangular:mainfrom
jullierme:fix-blank-space-form-field-float-label
Jul 22, 2024
Merged

fix(material/form-field): hiding a label after it has been shown leaves a blank space#29461
crisbeto merged 1 commit intoangular:mainfrom
jullierme:fix-blank-space-form-field-float-label

Conversation

@jullierme
Copy link
Copy Markdown
Contributor

There is a method _shouldLabelFloat that determines if the label should float. A check was added _hasFloatingLabel to see if a floating label exists before deciding whether the label should float. Examples were added at the end of the input-demo file, where you can see inputs without labels (both fixed and dynamic). Removing the solution also allows you to simulate the described error. Unit tests were added to validate the solution.

Fixes #29401

shown leaves a blank space

There is a method _shouldLabelFloat that determines if the label
should float. A check was added `_hasFloatingLabel` to see if a
floating label exists before deciding whether the label should
float. Examples were added at the end of the input-demo file,
where you can see inputs without labels (both fixed and dynamic).
Removing the solution also allows you to simulate the described
error. Unit tests were added to validate the solution.

Fixes angular#29401
@jullierme jullierme requested a review from a team as a code owner July 19, 2024 13:58
@jullierme jullierme requested review from amysorto and crisbeto and removed request for a team July 19, 2024 13:58
@crisbeto crisbeto removed the request for review from amysorto July 21, 2024 08:33
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jul 21, 2024
@crisbeto crisbeto merged commit 13aef8c into angular:main Jul 22, 2024
crisbeto pushed a commit that referenced this pull request Jul 22, 2024
shown leaves a blank space

There is a method _shouldLabelFloat that determines if the label
should float. A check was added `_hasFloatingLabel` to see if a
floating label exists before deciding whether the label should
float. Examples were added at the end of the input-demo file,
where you can see inputs without labels (both fixed and dynamic).
Removing the solution also allows you to simulate the described
error. Unit tests were added to validate the solution.

Fixes #29401

(cherry picked from commit 13aef8c)
@jullierme jullierme deleted the fix-blank-space-form-field-float-label branch July 22, 2024 14:22
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(material/form-field): hiding a label after it has been shown leaves a blank space

2 participants