Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

jullierme
Copy link
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 crisbeto and amysorto 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
12 checks passed
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

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