Skip to content
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

Can index-to-selected handle no selection? #22

Closed
justinbmeyer opened this issue Feb 12, 2017 · 3 comments
Closed

Can index-to-selected handle no selection? #22

justinbmeyer opened this issue Feb 12, 2017 · 3 comments

Comments

@justinbmeyer
Copy link
Contributor

http://canjs.com/doc/can-stache-converters.index-to-selected.html

Does the following work?

<select {($value)}="index-to-selected(~person, people)">
    <option value="-1">Select a person</option>
    {{#each people}}
        <option value="{{%index}}">{{name}}</option>
    {{/each}}
</select>

If not, we should make it work. Otherwise we should document it.

@cherifGsoul
Copy link
Member

cherifGsoul commented Sep 26, 2017

@justinbmeyer When the -1 value is selected, the selected item should be undefined ?
cc @phillipskevin

@justinbmeyer
Copy link
Contributor Author

Yeah, probably

cherifGsoul added a commit that referenced this issue Sep 27, 2017
@phillipskevin
Copy link
Contributor

I think since this is working as expected (as confirmed by #54), we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants