Skip to content

Commit

Permalink
fix: #166 - Searching and Adding elements cause the already selected …
Browse files Browse the repository at this point in the history
…elements to get added as a hidden element
  • Loading branch information
crlcu committed Jul 17, 2018
1 parent c5acf47 commit ddefce3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions dist/js/multiselect.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @license
*
* Multiselect v2.5.3
* Multiselect v2.5.4
* http://crlcu.github.io/multiselect/
*
* Copyright (c) 2016-2018 Adrian Crisan
Expand Down Expand Up @@ -206,7 +206,7 @@ if (typeof jQuery === 'undefined') {
self.$left.on('dblclick', 'option', function(e) {
e.preventDefault();

var $options = self.$left.find('option:selected');
var $options = self.$left.find('option:selected:visible');

if ( $options.length ) {
self.moveToRight($options, e);
Expand All @@ -227,7 +227,7 @@ if (typeof jQuery === 'undefined') {
if (e.keyCode === 13) {
e.preventDefault();

var $options = self.$left.find('option:selected');
var $options = self.$left.find('option:selected:visible');

if ( $options.length ) {
self.moveToRight($options, e);
Expand All @@ -239,7 +239,7 @@ if (typeof jQuery === 'undefined') {
self.$right.on('dblclick', 'option', function(e) {
e.preventDefault();

var $options = self.$right.find('option:selected');
var $options = self.$right.find('option:selected:visible');

if ( $options.length ) {
self.moveToLeft($options, e);
Expand All @@ -260,7 +260,7 @@ if (typeof jQuery === 'undefined') {
if (e.keyCode === 8 || e.keyCode === 46) {
e.preventDefault();

var $options = self.$right.find('option:selected');
var $options = self.$right.find('option:selected:visible');

if ( $options.length ) {
self.moveToLeft($options, e);
Expand All @@ -282,7 +282,7 @@ if (typeof jQuery === 'undefined') {
self.actions.$rightSelected.on('click', function(e) {
e.preventDefault();

var $options = self.$left.find('option:selected');
var $options = self.$left.find('option:selected:visible');

if ( $options.length ) {
self.moveToRight($options, e);
Expand All @@ -294,7 +294,7 @@ if (typeof jQuery === 'undefined') {
self.actions.$leftSelected.on('click', function(e) {
e.preventDefault();

var $options = self.$right.find('option:selected');
var $options = self.$right.find('option:selected:visible');

if ( $options.length ) {
self.moveToLeft($options, e);
Expand Down
Loading

0 comments on commit ddefce3

Please sign in to comment.