From a4867099beb0f49951d6765c3c5b2ae036dc7689 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 13 Dec 2023 07:10:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20table=20=E5=9C=A8=20IE?= =?UTF-8?q?=20=E4=B8=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1438 --- src/modules/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/table.js b/src/modules/table.js index 30f3827b..9eec4c7f 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -82,7 +82,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ var resolveTplStr = function(templet){ try{ return lay(templet).html(); - }catch{ + }catch(err){ return templet; } } From f48b5115f0385049a1a31c1a1003b8ca0006e7e5 Mon Sep 17 00:00:00 2001 From: morning-star <1453017105@qq.com> Date: Wed, 13 Dec 2023 22:38:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20select=20=E5=9C=A8=20I?= =?UTF-8?q?E10=20=E5=92=8C=2011=20=E4=B8=AD=E7=9A=84=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7=E9=97=AE=E9=A2=98=20(#1452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复 select 在 IE10 和 11 中的兼容性问题 close #1449 * update code --- src/modules/form.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/form.js b/src/modules/form.js index e66275da..174c401b 100644 --- a/src/modules/form.js +++ b/src/modules/form.js @@ -626,7 +626,12 @@ layui.define(['lay', 'layer', 'util'], function(exports){ }; if(isSearch){ - input.on('input propertychange', search).on('blur', function(e){ + // #1449: IE10 和 11 中,带有占位符的 input 元素获得/失去焦点时,会触发 input 事件 + var eventsType = 'input propertychange'; + if(lay.ie && (lay.ie === '10' || lay.ie === '11') && input.attr('placeholder')){ + eventsType = 'keyup'; + } + input.on(eventsType, search).on('blur', function(e){ var selectedIndex = select[0].selectedIndex; thatInput = input; // 当前的 select 中的 input 元素