Skip to content

Commit 9fc8329

Browse files
authored
fix(dropdown): forceSelection trigger event with null addition
When allowAdditions is handled by click event, forceSelection triggers event click again, but with allowAdditions removed can't find the item. As far as I know I can't know if the event calling this method is the original click or forceSelection trigger, so what I did is: if there's no element and allowAdditions and forceSelection is set to true return null.
1 parent ab3001c commit 9fc8329

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/definitions/modules/dropdown.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,8 +1945,8 @@ $.fn.dropdown = function(parameters) {
19451945
return ($choice.data(metadata.text) !== undefined)
19461946
? $choice.data(metadata.text)
19471947
: (preserveHTML)
1948-
? $choice.html().trim()
1949-
: $choice.text().trim()
1948+
? $choice.html() && $choice.html().trim()
1949+
: $choice.text() && $choice.text().trim()
19501950
;
19511951
}
19521952
},

0 commit comments

Comments
 (0)