File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ function init(Survey, $) {
6363 if ( isSettingValue ) return ;
6464 question . comment = $otherElement . val ( ) ;
6565 } ) ;
66+
6667 var updateComment = function ( ) {
6768 $otherElement . val ( question . comment ) ;
6869 if ( question . isOtherSelected ) {
@@ -105,12 +106,18 @@ function init(Survey, $) {
105106 $el . select2 ( settings ) ;
106107 question . keepIncorrectValues = true ;
107108 } else {
108- settings . data = question . visibleChoices . map ( function ( choice ) {
109- return {
110- id : choice . value ,
111- text : choice . text ,
112- } ;
113- } ) ;
109+ var data = [ ] ;
110+ if ( ! ! settings . placeholder || question . showOptionsCaption ) {
111+ data . push ( { id : "" , text : "" } ) ;
112+ }
113+ settings . data = data . concat (
114+ question . visibleChoices . map ( function ( choice ) {
115+ return {
116+ id : choice . value ,
117+ text : choice . text ,
118+ } ;
119+ } )
120+ ) ;
114121 $el . select2 ( settings ) ;
115122 }
116123 // fixed width accrording to https://stackoverflow.com/questions/45276778/select2-not-responsive-width-larger-than-container
You can’t perform that action at this time.
0 commit comments