fix select bug
This commit is contained in:
parent
5903266d54
commit
756252ccf0
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -153,7 +153,7 @@ layui.define('layer', function(exports){
|
|||||||
var othis = $(this)
|
var othis = $(this)
|
||||||
,text = othis.text()
|
,text = othis.text()
|
||||||
,not = text.indexOf(value) === -1;
|
,not = text.indexOf(value) === -1;
|
||||||
if(value === '' || (keyup ? not : value !== text)) num++;
|
if(value === '' || not) num++;
|
||||||
keyup && othis[not ? 'addClass' : 'removeClass'](HIDE);
|
keyup && othis[not ? 'addClass' : 'removeClass'](HIDE);
|
||||||
});
|
});
|
||||||
var none = num === dds.length;
|
var none = num === dds.length;
|
||||||
@ -179,14 +179,19 @@ layui.define('layer', function(exports){
|
|||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
if(value === ''){
|
||||||
|
dl.find('.'+NONE).remove();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if(isSearch){
|
if(isSearch){
|
||||||
input.on('keyup', search).on('blur', function(e){
|
input.on('keyup', search).on('blur', function(e){
|
||||||
thatInput = input;
|
thatInput = input;
|
||||||
initValue = dl.find('.'+THIS).html();
|
initValue = dl.find('.'+THIS).html();
|
||||||
if(!initValue){
|
notOption(input.val(), function(none){
|
||||||
input.val('');
|
if(none && !initValue){
|
||||||
}
|
input.val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user