Skip to content

Commit

Permalink
on result item click, refocus field (multiple only)
Browse files Browse the repository at this point in the history
changed attr to prop (it was causing issues)
  • Loading branch information
sergiodlopes committed Feb 13, 2017
1 parent f7b0d01 commit 73f89d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions jquery.flexdatalist.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Autocomplete for input fields, with support for datalists.
*
* Version:
* 1.9.0
* 1.9.1
*
* Depends:
* jquery.js 1.7+
Expand Down Expand Up @@ -204,7 +204,7 @@ jQuery.fn.flexdatalist = function (options, value) {
window.onresize = function (event) {
$this._position();
};
$this.addClass('flexdatalist flexdatalist-set').attr('type', 'hidden');
$this.addClass('flexdatalist flexdatalist-set').prop('type', 'hidden');
}

/**
Expand Down Expand Up @@ -847,12 +847,14 @@ jQuery.fn.flexdatalist = function (options, value) {
return $this;
}
$_this.val('');
var $li = $('<li>')
var $inputContainer = $ulMultiple.find('li.input-container'),
$li = $('<li>')
.addClass('value' + (_options.toggleSelected ? ' toggle' : ''))
.append('<span class="text">' + text + '</span>')
.append('<span class="fdl-remove">&times;</span>')
.insertBefore($ulMultiple.find('li.input-container'));

.insertBefore($inputContainer);
// Refocus input
$inputContainer.find('input').focus();
$li.find('span.fdl-remove').click(function () {
var $container = $(this).parent(),
index = $container.index();
Expand Down
Loading

0 comments on commit 73f89d1

Please sign in to comment.