Skip to content

Commit

Permalink
Fix submit on select drop down where there is one result (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
acetousk authored Sep 28, 2023
1 parent 3e77b3e commit 35ebf46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base-component/webroot/screen/webroot/js/WebrootVue.qvt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ Vue.component('m-drop-down', {

// console.warn("curOptions updated " + this.name + " allowEmpty " + this.allowEmpty + " value '" + this.value + "' " + " isInNewOptions " + isInNewOptions + ": " + JSON.stringify(options));
if (!isInNewOptions) {
if (!this.allowEmpty && !this.multiple && options && options.length && options[0].value && (!this.requiredManualSelect || options.length === 1)) {
if (!this.allowEmpty && !this.multiple && options && options.length && options[0].value && (!this.requiredManualSelect || (!this.submitOnSelect && options.length === 1))) {
// simulate normal select behavior with no empty option (not allowEmpty) where first value is selected by default
// console.warn("checkCurrentValue setting " + this.name + " to " + options[0].value + " options " + options.length);
this.$emit('input', options[0].value);
Expand Down

0 comments on commit 35ebf46

Please sign in to comment.