Skip to content

Commit d262f64

Browse files
authoredOct 28, 2023
修复屏蔽Lable内元素的焦点,而导致的switch及checkbox不可改值的问题
1 parent 26779de commit d262f64

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed
 

‎Scripts/DmYY.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -1046,14 +1046,14 @@ class DmYY {
10461046
border-radius:50%;
10471047
border: 1px solid #F6D377;
10481048
}
1049-
.form-item {
1049+
.form-item, .form-item-Switch {
10501050
display: flex;
10511051
align-items: center;
10521052
justify-content: space-between;
10531053
font-size: ${settingItemFontSize}px;
10541054
font-weight: 400;
10551055
min-height: 2.2em;
1056-
padding: 0.5em 18px;
1056+
padding: 0.5em 10px;
10571057
position: relative;
10581058
}
10591059
label > * {
@@ -1095,14 +1095,18 @@ class DmYY {
10951095
border-radius:3px;
10961096
}
10971097
1098-
.form-item + .form-item::before {
1098+
.form-item + .form-item::before,
1099+
.form-item-switch + .form-item::before,
1100+
.form-item + .form-item-switch::before
1101+
{
10991102
content: "";
11001103
position: absolute;
11011104
top: 0;
1102-
left: 20px;
1105+
left: 0;
11031106
right: 0;
11041107
border-top: 0.5px solid var(--divider-color);
11051108
}
1109+
11061110
.form-item input[type="checkbox"] {
11071111
width: 2em;
11081112
height: 2em;
@@ -1330,9 +1334,16 @@ class DmYY {
13301334
menuItem.type
13311335
}" enterkeyhint="done" value="${menuItem.defaultValue || ""}">`;
13321336
}
1333-
1337+
1338+
let addLable = "";
1339+
if(menuItem.type === "switch" || menuItem.type === "checkbox") {
1340+
addLable = `<label id="${idName}" class="form-item-switch form-item--link">`;
1341+
} else {
1342+
addLable = `<label id="${idName}" class="form-item form-item--link">`;
1343+
}
1344+
13341345
configList += `
1335-
<label id="${idName}" class="form-item form-item--link">
1346+
${addLable}
13361347
<div class="form-label item-none">
13371348
<img class="form-label-img" class="form-label-img" src="${iconBase64}"/>
13381349
<div class="form-label-title">${menuItem.title}</div>

0 commit comments

Comments
 (0)
Failed to load comments.