@ctrliq/quantic-components 1.63.3 → 1.63.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,7 @@ export declare class Combobox extends Combobox_base {
46
46
  private nextNavigableIndex;
47
47
  private openList;
48
48
  private closeList;
49
- private commitCustomValue;
49
+ private commitInputValue;
50
50
  private positionListbox;
51
51
  private selectOption;
52
52
  private handleInput;
@@ -116,8 +116,8 @@ let Combobox = class Combobox extends A11yAttributesMixin(QuanticElement) {
116
116
  this._activeIndex = -1;
117
117
  this.cleanup?.();
118
118
  this.cleanup = undefined;
119
- if (this.allowCustomValue && commit) {
120
- this.commitCustomValue();
119
+ if (commit && (this.allowCustomValue || !this._inputValue.trim())) {
120
+ this.commitInputValue();
121
121
  }
122
122
  else {
123
123
  const selected = this.options.find((o) => o.value === this.value);
@@ -125,7 +125,7 @@ let Combobox = class Combobox extends A11yAttributesMixin(QuanticElement) {
125
125
  selected?.label ?? (this.allowCustomValue ? this.value : '');
126
126
  }
127
127
  }
128
- commitCustomValue() {
128
+ commitInputValue() {
129
129
  const trimmed = this._inputValue.trim();
130
130
  this._inputValue = trimmed;
131
131
  if (trimmed === this.value)
@@ -223,10 +223,10 @@ let Combobox = class Combobox extends A11yAttributesMixin(QuanticElement) {
223
223
  this.selectOption(opt);
224
224
  }
225
225
  }
226
- else if (this.allowCustomValue && this._inputValue.trim()) {
226
+ else if (this._open &&
227
+ (this.allowCustomValue || !this._inputValue.trim())) {
227
228
  e.preventDefault();
228
229
  this.closeList(true);
229
- this.commitCustomValue();
230
230
  }
231
231
  break;
232
232
  case 'Escape':
@@ -757,7 +757,7 @@ __decorate([
757
757
  ], Combobox.prototype, "_activeIndex", void 0);
758
758
  Combobox = __decorate([
759
759
  event('value-changed', {
760
- description: 'Fired when the user selects an option from the list, or commits a custom value when allowCustomValue is enabled.',
760
+ description: 'Fired when the user selects an option from the list, clears the field, or commits a custom value when allowCustomValue is enabled.',
761
761
  detail: '{ value: string }',
762
762
  }),
763
763
  event('input-changed', {