I read all question about this error and I cannot find the problem in my code. Here it is:
HTML:
<!-- ComboBox Main Guilds-->
<lightning-vertical-navigation>
<lightning-vertical-navigation-section>
<lightning-combobox name={guildCb} label={guildCb} placeholder={guildPlaceCb} class="validgGuild"
options={optionsGuildToShow} onchange={handleGuildOnChange} value={idGuild} required>
</lightning-combobox>
</lightning-vertical-navigation-section>
</lightning-vertical-navigation>
<!-- ComboBox to Other Guilds -->
<lightning-vertical-navigation if:true={showOtherGuilds}>
<lightning-vertical-navigation-section>
<lightning-combobox name="Others" label="Others" placeholder={guildPlaceCb} class="validOtherGuild"
options={otherOptionsToShow} onchange={handleOtherGuildOnChange} value={idOtherGuild} required>
</lightning-combobox>
</lightning-vertical-navigation-section>
</lightning-vertical-navigation>
JS:
handleGuildOnChange(event) {
// Get key and clean ComboBox from work type.
this.idGuild = event.detail.value;
console.log('TEST IDGUILD->' + this.idGuild);
if(this.idGuild === 'Others') {
this.showOtherGuilds = true;
} else {
this.showOtherGuilds = false;
}
this.optionsWorkType = [];
this.idWorkType = null;
this.setValidity();
const workTypes = this.mapWorkTypes.get(this.idGuild);
if (workTypes.length === 0) {
this.noWorkTypeError = true;
} else {
this.noWorkTypeError = false;
for (const wrapper of workTypes) {
const option = {
label: wrapper.test,
value: wrapper.test
};
this.optionsWorkType = [...this.optionsWorkType, option];
}
// Enable ComboBox from work types.
this.disableWorkTypes = false;
}
}
handleOtherGuildOnChange(event) {
// Get key and clean ComboBox from work type.
this.idOtherGuild = event.detail.value;
this.optionsWorkType = [];
this.idWorkType = null;
this.setOtherValidity();
const workTypes = this.mapWorkTypes.get(this.idOtherGuild);
if (workTypes.length === 0) {
this.noWorkTypeError = true;
} else {
this.noWorkTypeError = false;
for (const wrapper of workTypes) {
const option = {
label: wrapper.test,
value: wrapper.test2
};
this.optionsWorkType = [...this.optionsWorkType, option];
}
this.disableWorkTypes = false;
}
}
This is my main code about this part. I could paste more code if you need it for solving problem. My code works okay, and runs information and data; but the problem is, when I select the picklist value, I get the error [NoErrorObjectAvailable] Script error prompt. Then, I click OK and I can continue my development.
Error happens when I select the option 'Other' in my picklist ComboBox Main Guilds.
Any idea?