Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Checkboxes in md-select when multiple selection is possible #3244

Closed
FDIM opened this issue Jun 12, 2015 · 14 comments
Closed

Checkboxes in md-select when multiple selection is possible #3244

FDIM opened this issue Jun 12, 2015 · 14 comments

Comments

@FDIM
Copy link
Contributor

FDIM commented Jun 12, 2015

Hi,
I am doing a rapid prototyping and I have heard multiple complains/suggestions from colleagues/clients/stakeholders that in select dropdown it is not clear when you can choose multiple items and when only one.

I propose to add a checkbox to each item for md-select[multiple]. While it is simple enough to add, it would be nice if something like this would be included in default distribution.

image

Result in the picture can be achieved with this less snippet:

// multi select dropdown with checkboxes
md-select-menu[multiple] {
    md-option {
        padding-left: 48px;
        &:before {
            transition: 240ms;
            position: absolute;
            top: 15px;
            left: 16px;
            width: 18px;
            height: 18px;
            border: 2px solid;
            border-radius: 2px;
            content: ' ';
            border-color: rgba(0, 0, 0, 0.54);
            z-index: 1;
        }
        &[selected] {
            &:before {
                background-color: rgba(30, 136, 229, 0.87);
                border-color: rgba(30, 136, 229, 0.87);
            }
            &:after {
                -webkit-transform: rotate(45deg);
                transform: rotate(45deg);
                position: absolute;
                top: 17px;
                left: 22px;
                display: table;
                width: 6px;
                height: 12px;
                border: 2px solid;
                border-top: 0;
                border-left: 0;
                content: ' ';
                z-index: 2;
                border-color: rgb(255, 255, 255);
            }
        }
    }
}

Unfortunately there is more work involved to support themes.

@FDIM FDIM changed the title Improvement to multiple md-select Checkboxes in md-select when multiple selection is possible Jun 12, 2015
@ThomasBurleson ThomasBurleson modified the milestone: 0.11.0 Jun 16, 2015
@ahmadhsalim
Copy link

Agreed. This should be possible for md-menu too.

@sitic
Copy link

sitic commented Jul 9, 2015

+1, I've received complaints from users about the non-obvious multiple select.

@phynweb
Copy link

phynweb commented Jul 13, 2015

Per @ThomasBurleson, moving comments from #3610 which is closed since its a duplicate of this.


A few ideas for enhancing the md-select directive when multiple is true. All use-cases derived from the Option Groups select demo. Codepen with multiple set to true on toppings: http://codepen.io/anon/pen/rVdzzb

  1. While the current selection is quite clear for single selections since the dropdown closes on select and populates the select text with the selection, this is not the case for multiple selections. The color difference between selected and unselected items is a bit too subtle if we contemplate a large list (e.g. 100+ items). A check icon or some other visual cue would be helpful while the user scrolls through the list.
  2. The current functionality adds the name of all selected items to the select text. This works well if we're selecting a few items. For a large list, it might be more useful have a multiple-placeholder option that says "100 Items selected", or simply retains the placeholder "Select items..." instead of listing every item which would create a very wide select area that ends up getting cut off i.e. losing the usefulness of listing the items anyway

Regarding item 2 above, i see it was discussed earlier here: #2684 and i agree with that logic for single md-select mode. I do think that enabling the multiple option presents a different problem of potentially confusing the user if we only display the first few options out of a large number, giving no cues as more items are selected and added to the end of option.textContent being used as the display value.

@phynweb
Copy link

phynweb commented Jul 29, 2015

@FDIM Pretty random question if you don't mind...what is the name of the font in the screenshot you posted above?

@FDIM
Copy link
Contributor Author

FDIM commented Jul 29, 2015

@phynweb It's Zetta Sans, used according to brand guidelines :)

@phynweb
Copy link

phynweb commented Jul 29, 2015

@FDIM thanks, i might need to find a reason to use it :-)

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-beta1, REVISIT, post-1.0 Aug 10, 2015
@tejasrivastav
Copy link

+1 would be awesome

1 similar comment
@sreekumarp
Copy link

+1 would be awesome

@mprentic-harris
Copy link
Contributor

It seems like this is a duplicate/add on to #2239

@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Jan 5, 2016
@lakshmikant4u
Copy link

It would be great to see this coming in new release.!

@my9074
Copy link

my9074 commented Feb 4, 2016

The current functionality adds the name of all selected items to the select text. This works well if we're selecting a few items. For a large list, it might be more useful have a multiple-placeholder option that says "100 Items selected", or simply retains the placeholder "Select items..." instead of listing every item which would create a very wide select area that ends up getting cut off i.e. losing the usefulness of listing the items anyway

+1 This is a normal needs

@ErinCoughlan ErinCoughlan added in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs EOC labels Mar 2, 2016
@ErinCoughlan ErinCoughlan modified the milestones: EOC - Q1, Backlog Mar 2, 2016
@ThomasBurleson
Copy link
Contributor

Related to PR #7301

@ErinCoughlan
Copy link
Contributor

@my9074 Custom text, such as "100 items selected", is issue #7384

@idlethumbs
Copy link

I have created a similar result in the theme-select.scss that should respond to primary colours etc.,

this version uses the exact same check tick as is used elsewhere in the spec.
there isn't any animation on it yet though!


md-select-menu[multiple] md-option {
    padding-left:32px;padding-right: 32px;
    &[selected] .md-text:before {

        box-sizing: border-box;
         -webkit-transform: rotate(45deg);
         transform: rotate(45deg);
         position: absolute;
         left: 14px;
         display: table;
         width: 6.67px;
         height: 13.33px;
         border-width: 2px;
         border-style: solid;
         border-top: 0;
         border-left: 0;
         content: '';
    }
}

@DerekLouie DerekLouie assigned DerekLouie and unassigned ErinCoughlan Mar 4, 2016
@ThomasBurleson ThomasBurleson removed the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Apr 25, 2016
@Splaktar Splaktar modified the milestones: EOC - Q1, 1.1.0 Jul 5, 2019
@angular angular locked as resolved and limited conversation to collaborators Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests