Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

select: form remains valid in a required md-select when empty option is selected #10005

Closed

Description

@dephiros

Actual Behavior:

  • What is the issue? *
    • mdSelect with "required" set in a form; use as empty option to clear select
    • select a non-empty option, form become valid
    • select empty option, form remains valid
  • What is the expected behavior?
    • form should become invalid

CodePen (or steps to reproduce the issue): *

Angular Versions: *

  • Angular Version: 1.5.5
  • Angular Material Version: 1.1.1

Additional Information:

  • Browser Type: * chrome
  • Browser Version: * latest
  • OS: * macOS
  • Stack Traces:

Activity

  1. topherfangio commented on Nov 12, 2016

    @topherfangio
    Contributor

    I don't think I am understanding your use-case. If the field is required, you shouldn't have any empty option right?

  2. dephiros commented on Nov 13, 2016

    @dephiros
    Author

    The requirement that I have designing the form is all select should have the an empty option to clear the select after user selecting a valid value. We just use this as the standard select across everywhere in the application regardless if the field is required or not

  3. topherfangio commented on Nov 13, 2016

    @topherfangio
    Contributor

    I guess if you're attempting to use these together, it does seem like the md-option-empty should indeed reset the validity of the model. However, I'll leave this to @ThomasBurleson's judgement as to whether or not this should be considered a bug.

  4. changed the title [-]mdSelect: form remains valid after deselect a required md-select with empty option [/-] [+]select: form remains valid in a required md-select when empty option is selected[/+] on Aug 26, 2019
  5. Splaktar commented on Aug 26, 2019

    @Splaktar
    Contributor

    This updated CodePen demonstrates how this is still an issue in 1.1.20 in addition to providing a side-by-side comparison to a regular select with AngularJS. This certainly seems like a bug that needs to be fixed.

    Reference: https://stackoverflow.com/questions/12654631/why-does-angularjs-include-an-empty-option-in-select

  6. added this to the 1.1.22 milestone on Aug 26, 2019
  7. self-assigned this
    on Aug 26, 2019
  8. added
    P2: requiredIssues that must be fixed.
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    on Aug 26, 2019
  9. modified the milestones: 1.1.22, 1.1.23 on Oct 22, 2019
  10. modified the milestones: 1.1.23, 1.2.0 on Jun 8, 2020
  11. modified the milestones: 1.2.0, 1.2.1 on Jul 29, 2020
  12. modified the milestones: 1.2.1, 1.2.2 on Sep 14, 2020
  13. added
    has: Pull RequestA PR has been created to address this issue
    and removed
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    on Dec 16, 2020
  14. added a commit that references this issue on Dec 16, 2020
    0ca89fa
  15. added a commit that references this issue on Dec 16, 2020
    61412b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions