Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

Selectable dropdown.

Open h2u opened this issue 13 years ago • 9 comments

Any style of selectable dropdown not working. Dropdown menu is working but value does not change by selecting any of item.

h2u avatar Oct 05 '13 20:10 h2u

I've verified in the docs version that the selection dropdown is changing the input field when a user selects a choice.

Can you fork this jsfiddle to show a test case? http://jsfiddle.net/jlukic/Vbr9d/1/

jlukic avatar Oct 06 '13 01:10 jlukic

Maybe im doing something wrong, but im doing it like this: http://jsfiddle.net/UEnQD/ Value does not change.

"I've verified in the docs version that the selection dropdown is changing the input field when a user selects a choice." In the docs everything works good to me too.

Im using Chrome 30.0.1599.69 m, packaged version of semantic.min.js 0.3.5 and jquery 1.10.2.

h2u avatar Oct 06 '13 09:10 h2u

Same issue.

cre-o avatar Oct 06 '13 13:10 cre-o

temporary solution for me is: http://jsfiddle.net/2CjSu/

h2u avatar Oct 06 '13 13:10 h2u

I found more sexy way to do it. Just use: http://jsfiddle.net/astronz/hfeft/

Problem with

if(settings.action == 'updateForm') {
  module.set.selected();
}

At dropdown.js:84

cre-o avatar Oct 06 '13 14:10 cre-o

Yea, that's cool ;)

h2u avatar Oct 06 '13 14:10 h2u

Dropdowns default action is just to hide the menu, other actions can be specified by using settings.action updateForm, updateText, etc. You can also trigger your own action after the default action by using a callback, or setting action to a function.

I can understand the confusion though because a selection dropdown in particular usually needs this field updated, so shouldnt its behavior be by default to update it? I'll mark this as an enhancement.

@astronz That line sets the current hidden input value to the selected text on initialization. So whatever value was already in the form shows up.

Heres an example http://jsfiddle.net/tRxqQ/

jlukic avatar Oct 06 '13 15:10 jlukic

This will be in next minor release.

jlukic avatar Oct 07 '13 05:10 jlukic

@jlukic Thank you so much!

cre-o avatar Oct 07 '13 18:10 cre-o