Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/bootstrap-tagsinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
this.isSelect = (element.tagName === 'SELECT');
this.multiple = (this.isSelect && element.hasAttribute('multiple'));
this.objectItems = options && options.itemValue;
this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : '';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make it work in ie7 slight change ...

this.placeholderText = this.$element.attr('placeholder') ? this.$element.attr('placeholder') : '';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to comment above ran into this problem as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.inputSize = Math.max(1, this.placeholderText.length);

this.$container = $('<div class="bootstrap-tagsinput"></div>');
this.$input = $('<input size="1" type="text" />').appendTo(this.$container);
this.$input = $('<input size="' + this.inputSize + '" type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container);

this.$element.after(this.$container);

Expand Down Expand Up @@ -343,7 +345,7 @@
}

// Reset internal input's size
$input.attr('size', Math.max(1, $input.val().length));
$input.attr('size', Math.max(this.inputSize, $input.val().length));
}, self));

// Remove icon clicked
Expand Down