@vaadin/vaadin-combo-box
Advanced tools
Comparing version 4.2.3 to 4.2.4
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-combo-box", | ||
"version": "4.2.3", | ||
"version": "4.2.4", | ||
"main": "vaadin-combo-box.js", | ||
@@ -16,0 +16,0 @@ "author": "Vaadin Ltd", |
@@ -91,3 +91,3 @@ /** | ||
const page = this._getPageForIndex(index); | ||
if (!this._hasPage(page)) { | ||
if (this._shouldLoadPage(page)) { | ||
this._loadPage(page); | ||
@@ -108,3 +108,3 @@ } | ||
_ensureFirstPage(opened) { | ||
if (opened && !this._hasPage(0)) { | ||
if (opened && this._shouldLoadPage(0)) { | ||
this._loadPage(0); | ||
@@ -114,8 +114,13 @@ } | ||
_hasPage(page) { | ||
_shouldLoadPage(page) { | ||
if (!this.filteredItems) { | ||
return false; | ||
return true; | ||
} | ||
const loadedItem = this.filteredItems[page * this.pageSize]; | ||
return loadedItem !== undefined && !(loadedItem instanceof ComboBoxPlaceholder); | ||
if (loadedItem !== undefined) { | ||
return loadedItem instanceof ComboBoxPlaceholder; | ||
} else { | ||
return this.size === undefined; | ||
} | ||
} | ||
@@ -154,5 +159,2 @@ | ||
} | ||
if (!this.size) { | ||
this.opened = false; | ||
} | ||
} | ||
@@ -188,3 +190,3 @@ }; | ||
_sizeChanged(size = 0) { | ||
const filteredItems = (this.filteredItems || []).slice(0); | ||
const filteredItems = (this.filteredItems || []).slice(0, size); | ||
for (let i = 0; i < size; i++) { | ||
@@ -191,0 +193,0 @@ filteredItems[i] = filteredItems[i] !== undefined ? filteredItems[i] : this.__placeHolder; |
@@ -892,3 +892,3 @@ /** | ||
if (!this._TemplateClass) { | ||
const tpl = this._itemTemplate || this.querySelector('template'); | ||
const tpl = this._itemTemplate || this._getRootTemplate(); | ||
if (tpl) { | ||
@@ -911,2 +911,6 @@ this._TemplateClass = templatize(tpl, this, { | ||
_getRootTemplate() { | ||
return Array.prototype.filter.call(this.children, elem => elem.tagName === 'TEMPLATE')[0]; | ||
} | ||
_preventInputBlur() { | ||
@@ -913,0 +917,0 @@ if (this._toggleElement) { |
@@ -242,3 +242,3 @@ /** | ||
static get version() { | ||
return '4.2.3'; | ||
return '4.2.4'; | ||
} | ||
@@ -245,0 +245,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106025
2569