bootstrap-combobox icon indicating copy to clipboard operation
bootstrap-combobox copied to clipboard

Combobox not selecting value in dropdown list.

Open lakipolitis opened this issue 8 years ago • 1 comments
trafficstars

I was experiencing an issue where the jQuery this.$source.val(this.map[val]).trigger('change');

was not forcing the select to actually highlight the option as selected. I noticed it on the demo as well. I'm using Chrome 57.0.2987.133

I changed that line of code (not nearly as clean as yours) to this:

      var v = this.map[val];
      this.$source.children().each(function () {
          if ($(this).val() == v) {
              $(this).attr('selected', 'selected');
          }
      });

And it's working nicely.

lakipolitis avatar Apr 19 '17 21:04 lakipolitis

As a note, I forgot to attach the change trigger and wasn't getting PostBack values in ASP.net. So I added it back and everything worked perfectly. Code now looks like this:


      var v = this.map[val];
      this.$source.children().each(function () {
          if ($(this).val() == v) {
              $(this).attr('selected', 'selected');
          }
      });
      this.$source.trigger('change');

lakipolitis avatar Apr 20 '17 15:04 lakipolitis