@vaadin/vaadin-combo-box
Advanced tools
Comparing version 5.0.0-alpha1 to 5.0.0
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-combo-box", | ||
"version": "5.0.0-alpha1", | ||
"version": "5.0.0", | ||
"main": "vaadin-combo-box.js", | ||
@@ -16,0 +16,0 @@ "author": "Vaadin Ltd", |
@@ -25,3 +25,2 @@ [![npm latest version](https://badgen.net/npm/v/@vaadin/vaadin-combo-box/latest)](https://www.npmjs.com/package/@vaadin/vaadin-combo-box) | ||
<script src="../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../iron-ajax/iron-ajax.html"> | ||
<link rel="import" href="vaadin-combo-box.html"> | ||
@@ -41,8 +40,11 @@ <custom-style> | ||
```html | ||
<dom-bind> | ||
<template> | ||
<iron-ajax url="https://randomuser.me/api?results=100&inc=name,email" last-response="{{response}}" auto></iron-ajax> | ||
<vaadin-combo-box label="User" placeholder="Please select" items="[[response.results]]" item-value-path="email" item-label-path="email"></vaadin-combo-box> | ||
</template> | ||
</dom-bind> | ||
<vaadin-combo-box label="User" placeholder="Please select" item-value-path="email" item-label-path="email"></vaadin-combo-box> | ||
<script> | ||
const comboBox = document.querySelector('vaadin-combo-box'); | ||
fetch('https://randomuser.me/api?results=100&inc=name,email') | ||
.then(res => res.json()) | ||
.then(json => comboBox.items = json.results); | ||
</script> | ||
``` | ||
@@ -49,0 +51,0 @@ |
@@ -220,2 +220,5 @@ /** | ||
_setPosition(e) { | ||
if (this.hidden) { | ||
return; | ||
} | ||
if (e && e.target) { | ||
@@ -222,0 +225,0 @@ const target = e.target === document ? document.body : e.target; |
@@ -6,4 +6,5 @@ /** | ||
*/ | ||
import '@polymer/polymer/lib/utils/async.js'; | ||
import { timeOut } from '@polymer/polymer/lib/utils/async.js'; | ||
import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; | ||
import { flush } from '@polymer/polymer/lib/utils/flush.js'; | ||
@@ -247,3 +248,3 @@ import { templatize } from '@polymer/polymer/lib/utils/templatize.js'; | ||
this.addEventListener('vaadin-combo-box-dropdown-closed', this._onClosed.bind(this)); | ||
this.addEventListener('vaadin-combo-box-dropdown-closed', this.close.bind(this)); | ||
this.addEventListener('vaadin-combo-box-dropdown-opened', this._onOpened.bind(this)); | ||
@@ -335,6 +336,6 @@ this.addEventListener('keydown', this._onKeyDown.bind(this)); | ||
} else { | ||
this._onClosed(); | ||
if (this._openedWithFocusRing && this.hasAttribute('focused')) { | ||
this.focusElement.setAttribute('focus-ring', ''); | ||
} | ||
this._onClosed(); | ||
} | ||
@@ -523,5 +524,3 @@ } | ||
if (!this.opened) { | ||
this._detectAndDispatchChange(); | ||
} | ||
this._detectAndDispatchChange(); | ||
} | ||
@@ -825,6 +824,2 @@ | ||
this.$.overlay.set('_items', items); | ||
if (this.opened) { | ||
this._resizeDropdown(); | ||
} | ||
} | ||
@@ -835,9 +830,15 @@ | ||
// (especially when aligned on top of input) | ||
setTimeout(() => { | ||
this._resizeDropdown(); | ||
this.$.overlay.updateViewportBoundaries(); | ||
this.$.overlay.ensureItemsRendered(); | ||
this.$.overlay._selector.notifyResize(); | ||
flush(); | ||
}, 1); | ||
this.__repositionOverlayDebouncer = Debouncer.debounce( | ||
this.__repositionOverlayDebouncer, | ||
// Long debounce: sizing updates invoke multiple styling rounds, | ||
// which is very slow in Edge | ||
timeOut.after(500), | ||
() => { | ||
this._resizeDropdown(); | ||
this.$.overlay.updateViewportBoundaries(); | ||
this.$.overlay.ensureItemsRendered(); | ||
this.$.overlay._selector.notifyResize(); | ||
flush(); | ||
} | ||
); | ||
} | ||
@@ -844,0 +845,0 @@ |
@@ -234,3 +234,3 @@ /** | ||
static get version() { | ||
return '5.0.0-alpha1'; | ||
return '5.0.0'; | ||
} | ||
@@ -237,0 +237,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
107714
2611
0
154