@vaadin/combo-box
Advanced tools
Comparing version 23.1.4 to 23.1.5
{ | ||
"name": "@vaadin/combo-box", | ||
"version": "23.1.4", | ||
"version": "23.1.5", | ||
"publishConfig": { | ||
@@ -39,21 +39,21 @@ "access": "public" | ||
"@polymer/polymer": "^3.0.0", | ||
"@vaadin/component-base": "^23.1.4", | ||
"@vaadin/field-base": "^23.1.4", | ||
"@vaadin/input-container": "^23.1.4", | ||
"@vaadin/item": "^23.1.4", | ||
"@vaadin/lit-renderer": "^23.1.4", | ||
"@vaadin/vaadin-lumo-styles": "^23.1.4", | ||
"@vaadin/vaadin-material-styles": "^23.1.4", | ||
"@vaadin/vaadin-overlay": "^23.1.4", | ||
"@vaadin/vaadin-themable-mixin": "^23.1.4" | ||
"@vaadin/component-base": "^23.1.5", | ||
"@vaadin/field-base": "^23.1.5", | ||
"@vaadin/input-container": "^23.1.5", | ||
"@vaadin/item": "^23.1.5", | ||
"@vaadin/lit-renderer": "^23.1.5", | ||
"@vaadin/vaadin-lumo-styles": "^23.1.5", | ||
"@vaadin/vaadin-material-styles": "^23.1.5", | ||
"@vaadin/vaadin-overlay": "^23.1.5", | ||
"@vaadin/vaadin-themable-mixin": "^23.1.5" | ||
}, | ||
"devDependencies": { | ||
"@esm-bundle/chai": "^4.3.4", | ||
"@vaadin/polymer-legacy-adapter": "^23.1.4", | ||
"@vaadin/polymer-legacy-adapter": "^23.1.5", | ||
"@vaadin/testing-helpers": "^0.3.2", | ||
"@vaadin/text-field": "^23.1.4", | ||
"@vaadin/text-field": "^23.1.5", | ||
"lit": "^2.0.0", | ||
"sinon": "^13.0.2" | ||
}, | ||
"gitHead": "0a82302064f1276a000f0cbd810076539407d133" | ||
"gitHead": "326938919a54353231af25d341ba6076c249afee" | ||
} |
@@ -8,2 +8,3 @@ /** | ||
import { dashToCamelCase } from '@polymer/polymer/lib/utils/case-map.js'; | ||
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js'; | ||
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js'; | ||
@@ -122,10 +123,10 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js'; | ||
super.ready(); | ||
this._toggleElement = this.querySelector('.toggle-button'); | ||
} | ||
/** @protected */ | ||
connectedCallback() { | ||
super.connectedCallback(); | ||
this._setInputElement(this.querySelector('vaadin-text-field,.input')); | ||
this._revertInputValue(); | ||
// Wait until the slotted input DOM is ready | ||
afterNextRender(this, () => { | ||
this._setInputElement(this.querySelector('vaadin-text-field,.input')); | ||
this._revertInputValue(); | ||
}); | ||
} | ||
@@ -152,2 +153,34 @@ | ||
/** | ||
* @protected | ||
* @override | ||
* @return {HTMLInputElement | undefined} | ||
*/ | ||
get _nativeInput() { | ||
const input = this.inputElement; | ||
if (input) { | ||
// Support `<input class="input">` | ||
if (input instanceof HTMLInputElement) { | ||
return input; | ||
} | ||
// Support `<input>` in light DOM (e.g. `vaadin-text-field`) | ||
const slottedInput = input.querySelector('input'); | ||
if (slottedInput) { | ||
return slottedInput; | ||
} | ||
if (input.shadowRoot) { | ||
// Support `<input>` in Shadow DOM (e.g. `mwc-textfield`) | ||
const shadowInput = input.shadowRoot.querySelector('input'); | ||
if (shadowInput) { | ||
return shadowInput; | ||
} | ||
} | ||
} | ||
return undefined; | ||
} | ||
/** @protected */ | ||
@@ -154,0 +187,0 @@ _isClearButton(event) { |
@@ -242,2 +242,12 @@ /** | ||
/** | ||
* Get a reference to the native `<input>` element. | ||
* Override to provide a custom input. | ||
* @protected | ||
* @return {HTMLInputElement | undefined} | ||
*/ | ||
get _nativeInput() { | ||
return this.inputElement; | ||
} | ||
/** | ||
* Override method inherited from `InputMixin` | ||
@@ -248,5 +258,7 @@ * to customize the input element. | ||
*/ | ||
_inputElementChanged(input) { | ||
super._inputElementChanged(input); | ||
_inputElementChanged(inputElement) { | ||
super._inputElementChanged(inputElement); | ||
const input = this._nativeInput; | ||
if (input) { | ||
@@ -351,3 +363,3 @@ input.autocomplete = 'off'; | ||
_updateActiveDescendant(index) { | ||
const input = this.inputElement; | ||
const input = this._nativeInput; | ||
if (!input) { | ||
@@ -388,3 +400,3 @@ return; | ||
const input = this.inputElement; | ||
const input = this._nativeInput; | ||
if (input) { | ||
@@ -1101,2 +1113,8 @@ input.setAttribute('aria-expanded', !!opened); | ||
_onFocusout(event) { | ||
// VoiceOver on iOS fires `focusout` event when moving focus to the item in the dropdown. | ||
// Do not focus the input in this case, because it would break announcement for the item. | ||
if (event.relatedTarget && this._getItemElements().includes(event.relatedTarget)) { | ||
return; | ||
} | ||
// Fixes the problem with `focusout` happening when clicking on the scroll bar on Edge | ||
@@ -1103,0 +1121,0 @@ if (event.relatedTarget === this.$.dropdown.$.overlay) { |
139877
3548
Updated@vaadin/field-base@^23.1.5
Updated@vaadin/item@^23.1.5
Updated@vaadin/lit-renderer@^23.1.5