[dropdown] allowAdditions callback without multiple selection #2306
Answered
by
lubber-de
ivangomes
asked this question in
Modules (Modal, Dropdown, Popup, Calendar, Toast, ...)
-
Basically my dropdown will do a search and let me add a new label, but I am wondering how I can get a callback form the new label or value and insert it into my database. I tried the callback onLabelCreate(value, text). But seems like it will only return if my dropdown allow multiple selections. class="ui fluid search selection dropdown" Any ideas? Thank you guys! |
Beta Was this translation helpful? Give feedback.
Answered by
lubber-de
Apr 6, 2022
Replies: 1 comment 1 reply
-
Use $('.ui.dropdown').dropdown({
allowAdditions: true,
onChange: function(value, text, $item) {
if ($item.hasClass('addition')) {
console.log('added ' + value);
}
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lubber-de
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
onChange
and check for classaddition