Browse Source

Merge pull request #1280 from zhangyutongdeyonghuming/main

layui-select 搜索筛选,删除 input 已有文本并放入 placeholder,方便输入
pull/1283/head
贤心 1 year ago committed by GitHub
parent
commit
2714854196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/modules/form.js

6
src/modules/form.js

@ -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();
}

Loading…
Cancel
Save