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

[Dropdown] "set selected" does not work for empty ('') value (using placeholder: false) #2637

Closed
michtill opened this issue Jul 14, 2015 · 3 comments
Milestone

Comments

@michtill
Copy link

http://jsfiddle.net/y7axjw2y/2/

I am using .ui.selection.dropdown with placeholder:false to have the empty value option in the list.
User can select it to set value ''.
But I am not able to set this option in code. In fact the component is not able to do it it self on initiate.
If I set any other value as the value of hidden input it is selected as option on start and the onchange
event is called on the input. But by using '' for the value='' option it does not work.

Calling .dropdown('set selected', '') does not work.

In fact calling .dropdown('clear') does not work, if there is not the div with class "default text" and any non empty content. <div class="default value"></div> does not work too.

So the empty value option is possible to have in the list now, but it is not fully supported by the component.

In any case thank you for all nice component and this one as well!!!

@jlukic jlukic added this to the 2.1 milestone Jul 14, 2015
@jlukic jlukic changed the title Selection Dropdown "set selected" does not work for empty ('') value (using placeholder: false) [Dropdown] "set selected" does not work for empty ('') value (using placeholder: false) Aug 6, 2015
jlukic added a commit that referenced this issue Aug 11, 2015
jlukic added a commit that referenced this issue Aug 11, 2015
jlukic added a commit that referenced this issue Aug 11, 2015
@jlukic
Copy link
Member

jlukic commented Aug 11, 2015

Demo with next branch. @michtill Let me know if this makes sense.
http://jsfiddle.net/ud2qxebd/

Clear will now correctly set value to "" when no placeholder. Fixed several placeholder issues, particularly with restore defaults.

Available in 2.1

@jlukic jlukic closed this as completed Aug 11, 2015
@michtill
Copy link
Author

Hello,

Works now perfectly.

Thank you very much!

Michal Tiller
Dne 12. 8. 2015 0:17 napsal uživatel "Jack Lukic" <[email protected]

:

Demo with next branch. @michtill https://github.com/michtill Let me
know if this makes sense.
http://jsfiddle.net/ud2qxebd/

Clear will now correctly set value to "" when no placeholder. Fixed
several placeholder issues, particularly with restore defaults.

Available in 2.1


Reply to this email directly or view it on GitHub
#2637 (comment)
.

@jlukic
Copy link
Member

jlukic commented Aug 12, 2015

Glad to know :)

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

2 participants