Merge pull request #1280 from zhangyutongdeyonghuming/main

layui-select 搜索筛选,删除 input 已有文本并放入 placeholder,方便输入
This commit is contained in:
贤心 2023-06-15 15:20:38 +08:00 committed by GitHub
commit 2714854196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,6 +314,12 @@ layui.define(['lay', 'layer', 'util'], function(exports){
reElem.addClass(CLASS + 'up');
}
// 删除input已有文本并放入 placeholder方便输入
if (input.val()) {
// 有值时才删除并替换placeholder
input.attr('placeholder', input.val());
input.val(''); // 清空输入框的值
}
followScroll();
}