Skip to content

Commit

Permalink
placeholder fix
Browse files Browse the repository at this point in the history
minor improvements
  • Loading branch information
sergiodlopes committed Sep 9, 2017
1 parent a54d1be commit 5c79b4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions jquery.flexdatalist.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Autocomplete input fields, with support for datalists.
*
* Version:
* 2.2.1
* 2.2.2
*
* Depends:
* jquery.js > 1.8.3
Expand Down Expand Up @@ -31,7 +31,8 @@ jQuery.fn.flexdatalist = function (_option, _value) {
.attr('style', null)
.val((options && options.originalValue && !clear ? options.originalValue : ''))
.removeData('flexdatalist')
.removeData('aliascontainer');
.removeData('aliascontainer')
.off();
$aliascontainer.remove();
}
});
Expand Down Expand Up @@ -259,8 +260,9 @@ jQuery.fn.flexdatalist = function (_option, _value) {
copyValue: function (event) {
if (_this.keyNum(event) !== 13) {
var keyword = $alias.val(),
val = _this.fvalue.get(true),
options = _this.options.get();
if (!options.multiple && !options.selectionRequired) {
if (!options.multiple && !options.selectionRequired && keyword.length !== val.length) {
_this.fvalue.extract(keyword);
}
}
Expand Down Expand Up @@ -388,7 +390,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
'class': $this.attr('class'),
'name': ($this.attr('name') ? 'flexdatalist-' + $this.attr('name') : null),
'id': aliasid,
'value': ''
'placeholder': $this.attr('placeholder')
})
.addClass('flexdatalist-alias ' + aliasid)
.removeClass('flexdatalist')
Expand Down
Loading

0 comments on commit 5c79b4a

Please sign in to comment.