Skip to content

Allow using 0 as a key in MdSelect #5024

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

Closed
wants to merge 1 commit into from

Conversation

eyalhakim
Copy link

fix(select): allow using 0 as a key

when using integers as keys, the value 0 is evaluated as an empty selection, because of the falsey condition instead, we should be explicitly checking for null, empty string or undefined.

fix(select): allow using 0 as a key

when using integers as keys, the value 0 is evaluated as an empty selection, because of the falsey condition instead, we should be explicitly checking for null, empty string or undefined.
@crisbeto
Copy link
Member

crisbeto commented Jun 8, 2017

I'm not sure what this is fixing. It's already possible to select 0.

@jelbourn
Copy link
Member

jelbourn commented Jun 8, 2017

@eyalhakim can you elaborate on what you're trying to solve?

@jelbourn jelbourn added the needs: discussion Further discussion with the team is needed before proceeding label Jun 8, 2017
@eyalhakim
Copy link
Author

Hi guys,

I am trying to solve the very issue @crisbeto recreated in his plunker.
My scenario is a bit more complicated, but even when trying to replicate my scenario using a fork from his environment, it does work.

However, in my environment, the same (or probably very similar) scenario doesn't work, unless i use the fix that i proposed here.

Any ideas how i can replicate my issue here? i also use the latest version of angular material.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 8, 2017
@crisbeto
Copy link
Member

crisbeto commented Jun 8, 2017

The fix that allowed falsy values to be selected got merged a few days ago (see 2e3910c). If you're using the latest stable version, you don't have it yet. You can either wait for the next release or install the latest master build:

npm install https://github.com/angular/material2-builds.git

@crisbeto crisbeto closed this Jun 8, 2017
@eyalhakim
Copy link
Author

ah-ha, perfect, thanks

@eyalhakim
Copy link
Author

@crisbeto for some reason, the indigo-pink theme is not included with this package.
Do you have an idea how to solve this?

@crisbeto
Copy link
Member

crisbeto commented Jun 8, 2017

It should be in there, but the location might've changed.

@eyalhakim
Copy link
Author

Couldn't find it, could you direct me to the right path?

@eyalhakim
Copy link
Author

@crisbeto

@crisbeto
Copy link
Member

crisbeto commented Jun 9, 2017

Sorry @eyalhakim, it seems like the prebuilt themes got broken at some point. They should be fixed by #5042.

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement needs: discussion Further discussion with the team is needed before proceeding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants