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(form-field): remove nonbreaking space before * for required fields #15490

Merged
merged 1 commit into from
Apr 2, 2019

Conversation

stevenyxu
Copy link
Contributor

The surrounding .mat-form-field-label is already white-space: nowrap so the   doesn't serve any
wrap-preventing function. But it does prevent any trailing spacing from collapsing with
the space before the asterisk, causing for a bad visual appearance of a double space in these cases.

Addresses #15489.

I attempted to use a literal space and not the symbol, but the compiler collapsed it for me.

@stevenyxu stevenyxu requested a review from mmalerba as a code owner March 14, 2019 23:05
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 14, 2019
@stevenyxu
Copy link
Contributor Author

I tried to add a test to check in a more deliberate way that the spaces were deliberate and there's no real DOM API I found to get the post-collapsing rendered text short of doing a screendiff test. Both innerText and textContent give the spaces pre-collapsing. I did adjust the test to match explicitly literal space and not \s which also matches non-breaking space, so the test would have failed without the change.

I did not add an explicit test that puts a trailing space in the placeholder or uses a mat-label because I wasn't sure it was worth a test. I have a change ready for it so if you want me to add it, let me know.

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Mar 15, 2019
@ngbot
Copy link

ngbot bot commented Mar 15, 2019

I see that you just added the pr: merge ready label, but the following checks are still failing:
    failure status "ci/circleci: bazel_build_test" is failing
    failure status "ci/circleci: tests_browserstack" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@mmalerba
Copy link
Contributor

@stevenyxu looks like there's some failing tests

@mmalerba mmalerba removed the action: merge The PR is ready for merge by the caretaker label Mar 15, 2019
@stevenyxu stevenyxu force-pushed the form-field branch 2 times, most recently from 5e76466 to f5f25c6 Compare March 15, 2019 23:30
The surrounding .mat-form-field-label is already white-space: nowrap so the   doesn't serve any
wrap-preventing function. But it does prevent any trailing <mat-label> spacing from collapsing with
the space before the asterisk, causing for a bad visual appearance of a double space in these cases.
@stevenyxu
Copy link
Contributor Author

@mmalerba sorry about that. Fixed and rebased today.

@mmalerba mmalerba added P2 The issue is important to a large percentage of users, with a workaround action: merge The PR is ready for merge by the caretaker G This is is related to a Google internal issue labels Mar 18, 2019
@mmalerba mmalerba merged commit debc56e into angular:master Apr 2, 2019
jelbourn pushed a commit that referenced this pull request Apr 4, 2019
#15490)

The surrounding .mat-form-field-label is already white-space: nowrap so the &nbsp; doesn't serve any
wrap-preventing function. But it does prevent any trailing <mat-label> spacing from collapsing with
the space before the asterisk, causing for a bad visual appearance of a double space in these cases.
@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 Sep 10, 2019
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 cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants