mdbootstrap / bootstrap-templates

A collection of free Bootstrap 5 templates.
https://mdbootstrap.com/freebies/
3.07k stars 1.01k forks source link

in multiple select When have been customized `itemValue`, it can not retrieve options. #642

Closed zareismail closed 2 years ago

zareismail commented 6 years ago

at code line: 464; bootstrap-tagsinput v0.6.1 by Tim Schlechter; at the end of build method; by this config:

$('select').tagsinput({
      itemValue: function() {
          // any thing
      },
      itemText: function() {
          // any thing
      }, 
});

maybe bug is here:

if (self.options.itemValue === defaultOptions.itemValue) {
        if (self.$element[0].tagName === 'INPUT') {
            self.add(self.$element.val());
        } else {
          $('option', self.$element).each(function() {
            self.add($(this).attr('value'), true);
          });
        }
 }

this is a bug !!!? maybe