Skip to content

invalid MdSelect should highlight itself on parent form submitted #4611

Closed

Description

@natsid

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Expect md-select to show red (or 'warning' color) if it is invalid and its parent form is submitted.

What is the current behavior?

Currently the select does show warning color on touched and invalid, but not on parent form submitted and invalid.

What are the steps to reproduce?

See this plunk. Both the select and the input are 'required'. Click 'submit' and see that the select does not change its appearance like the input does.

What is the use-case or motivation for changing an existing behavior?

Would like to highlight errors on submit.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

all

Is there anything else we should know?

The MdSelect likely needs to inject an @optional NgForm/@optional FormGroupDirective in its constructor like MdInputContainer does so that it can keep track of its submitted state.

Activity

  1. natsid commented on May 17, 2017

    @natsid
    Author

    The select's 'required' asterisk also is not 'warning' color in all the same states as it is in the input:

    When an input is focused (and valid or untouched), the asterisk is 'warning' even though everything else is 'primary'. When a select is focused, everything is 'primary' including the asterisk.

  2. added
    P3
    on May 18, 2017
  3. added a commit that references this issue on May 23, 2017
    46ae1f4
  4. added 2 commits that reference this issue on May 31, 2017
    3d8c223
    cf4ec30
  5. added 2 commits that reference this issue on Jul 22, 2017
    15be464
    57f5f7c
  6. added a commit that references this issue on Jul 27, 2017
    6f73b35
  7. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions