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: multiple attribute only checks for existence but docs indicate that it evaluates true/false #3068

Closed

Description

@myagoo

If I want to tell wether a md-select should be multiple from a scope key, I must do this :

<md-select ng-if="multiple" multiple .../>
<md-select ng-if="!multiple" .../>

Because all those lines have the same behavior, they set initialize the select as multiple :

<md-select multiple="true" .../>
<md-select multiple="false" .../>
<md-select multiple="{{true}}" .../>
<md-select multiple="{{false}}" .../>

In the source code of md-select directive, I can see this LoC :
https://github.com/angular/material/blob/master/src/components/select/select.js#L387
I can understand why all 4 lines have the same behavior.

So I tried to use ng-multiple and the select started to work correctly... in appearance only : the model is now all messed up.

Here is a codepen where you can see select behavior and the associated model : http://codepen.io/myagoo/pen/OVWGqz

Activity

  1. modified the milestone: on Jul 6, 2015
  2. dharitdesai commented on Dec 15, 2015

    @dharitdesai

    +1

  3. pdore-netfore commented on Dec 15, 2015

    @pdore-netfore
    Contributor

    +1

  4. modified the milestones: , Deprecated on Apr 20, 2016
  5. nextsoftpl commented on Oct 25, 2016

    @nextsoftpl

    +1

  6. danicomas commented on Jun 1, 2018

    @danicomas

    No news?

  7. 5 remaining items

  8. added
    P4: minorMinor issues. May not be fixed without community contributions.
    on Jun 6, 2018
  9. Splaktar commented on Jun 6, 2018

    @Splaktar
    Contributor

    Re-opening this one as the CodePen is still valid and this issue still exists.

  10. Splaktar commented on Jun 6, 2018

    @Splaktar
    Contributor

    This seems to be partially related to angular/angular.js@d87fa00 where binding to multiple on select elements was disabled in AngularJS 1.2.0.

  11. Splaktar commented on Jun 6, 2018

    @Splaktar
    Contributor

    There is a lot more discussion related to that in:
    angular/angular.js#3230
    angular/angular.js#3337

  12. Splaktar commented on Jun 6, 2018

    @Splaktar
    Contributor

    As mentioned in those issues and #9705, ng-multiple was also removed in AngularJS 1.2.0.

    We need to remove it from AngularJS Material as well. This removal is being tracked in #9705.

  13. Splaktar commented on Jun 6, 2018

    @Splaktar
    Contributor

    The docs are going to be updated to state:

    multiple boolean When present, allows for more than one option to be selected. The model is an array with the selected choices. Note: This attribute is only evaluated once; it is not watched.

    Any value that is passed into the multiple attribute will be ignored.

  14. added a commit that references this issue on Jun 6, 2018
    6a443a1
  15. added a commit that references this issue on Jun 22, 2018
    a6bca73
  16. added a commit that references this issue on Jul 31, 2018
    cbd443e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P4: minorMinor issues. May not be fixed without community contributions.has: Pull RequestA PR has been created to address this issueresolution: fixedtype: docs

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions