mirror of
https://gitee.com/layui/layui.git
synced 2025-06-28 13:34:27 +08:00
fix(form): 修复 input 设置 lay-vertype="tips"
验证时 tips 层定位异常问题 (#2605)
This commit is contained in:
parent
6163817a26
commit
b6bd3850a9
@ -863,7 +863,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
|||||||
var selected = $(select.options[select.selectedIndex]); // 获取当前选中项
|
var selected = $(select.options[select.selectedIndex]); // 获取当前选中项
|
||||||
var optionsFirst = select.options[0];
|
var optionsFirst = select.options[0];
|
||||||
|
|
||||||
if(othis.closest('[lay-ignore]').length > 0) return othis.show();
|
if (othis.closest('[lay-ignore]').length) return othis.show();
|
||||||
|
|
||||||
var isSearch = typeof othis.attr('lay-search') === 'string'
|
var isSearch = typeof othis.attr('lay-search') === 'string'
|
||||||
var isCreatable = typeof othis.attr('lay-creatable') === 'string' && isSearch
|
var isCreatable = typeof othis.attr('lay-creatable') === 'string' && isSearch
|
||||||
@ -1028,7 +1028,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
|||||||
// 若为开关,则对 title 进行分隔解析
|
// 若为开关,则对 title 进行分隔解析
|
||||||
title = skin === 'switch' ? title.split('|') : [title];
|
title = skin === 'switch' ? title.split('|') : [title];
|
||||||
|
|
||||||
if(othis.closest('[lay-ignore]').length > 0) return othis.show();
|
if (othis.closest('[lay-ignore]').length) return othis.show();
|
||||||
|
|
||||||
// 处理 IE8 indeterminate 属性重新定义 get set 后无法设置值的问题
|
// 处理 IE8 indeterminate 属性重新定义 get set 后无法设置值的问题
|
||||||
if(needCheckboxFallback){
|
if(needCheckboxFallback){
|
||||||
@ -1111,7 +1111,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
|||||||
var disabled = this.disabled;
|
var disabled = this.disabled;
|
||||||
var skin = othis.attr('lay-skin');
|
var skin = othis.attr('lay-skin');
|
||||||
|
|
||||||
if(othis.closest('[lay-ignore]').length > 0) return othis.show();
|
if (othis.closest('[lay-ignore]').length) return othis.show();
|
||||||
|
|
||||||
if(needCheckboxFallback){
|
if(needCheckboxFallback){
|
||||||
toggleAttribute.call(radio, 'lay-form-sync-checked', radio.checked);
|
toggleAttribute.call(radio, 'lay-form-sync-checked', radio.checked);
|
||||||
@ -1301,11 +1301,12 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
|||||||
// 提示层风格
|
// 提示层风格
|
||||||
if (verType === 'tips') {
|
if (verType === 'tips') {
|
||||||
layer.tips(errorText, function() {
|
layer.tips(errorText, function() {
|
||||||
if (othis.closest('[lay-ignore]').length > 0) {
|
if (!othis.closest('[lay-ignore]').length) {
|
||||||
return othis;
|
if(isForm2Elem) {
|
||||||
} else if(isForm2Elem) {
|
|
||||||
return othis.next();
|
return othis.next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return othis;
|
||||||
}(), {tips: 1});
|
}(), {tips: 1});
|
||||||
} else if(verType === 'alert') {
|
} else if(verType === 'alert') {
|
||||||
layer.alert(errorText, {title: '提示', shadeClose: true});
|
layer.alert(errorText, {title: '提示', shadeClose: true});
|
||||||
|
Loading…
Reference in New Issue
Block a user