Refixed tabIndex on the connector window with a better method

This commit is contained in:
NI
2020-05-18 23:31:31 +08:00
parent 5269901ad1
commit 3ec9669057
2 changed files with 17 additions and 13 deletions

View File

@@ -409,12 +409,7 @@ export default {
this.current.fields.push(f); this.current.fields.push(f);
const newTabIndex = f.nextTabIndex(); tabIndex = f.nextTabIndex();
// Ignore if the field does not contain tabIndex
if (newTabIndex > 1) {
tabIndex = newTabIndex;
}
} }
this.submitterTabIndex = tabIndex > 0 ? tabIndex : 1; this.submitterTabIndex = tabIndex > 0 ? tabIndex : 1;

View File

@@ -49,17 +49,26 @@ export function build(tabIndex, i, field) {
blockedSuggestionValue: "", blockedSuggestionValue: "",
blockingSuggestion: false, blockingSuggestion: false,
nextTabIndex() { nextTabIndex() {
let nextTabIndex = 0;
if (this.field.readonly) { if (this.field.readonly) {
return this.tabIndex; nextTabIndex = this.tabIndex;
} else {
switch (this.field.type) {
case "radio":
nextTabIndex = this.tabIndex + this.field.example.split(",").length;
break;
default:
nextTabIndex = this.tabIndex + 1;
}
} }
switch (this.field.type) { if (tabIndex >= nextTabIndex) {
case "radio": return tabIndex;
return this.tabIndex + this.field.example.split(",").length;
default:
return this.tabIndex + 1;
} }
return nextTabIndex;
}, },
nextSubTabIndex(subIndex) { nextSubTabIndex(subIndex) {
if (this.field.readonly) { if (this.field.readonly) {