Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vaadin/vaadin-combo-box

Package Overview
Dependencies
Maintainers
16
Versions
304
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/vaadin-combo-box - npm Package Compare versions

Comparing version 5.2.0-alpha1 to 5.2.0-alpha2

2

package.json

@@ -13,3 +13,3 @@ {

"name": "@vaadin/vaadin-combo-box",
"version": "5.2.0-alpha1",
"version": "5.2.0-alpha2",
"main": "vaadin-combo-box.js",

@@ -16,0 +16,0 @@ "author": "Vaadin Ltd",

@@ -13,2 +13,15 @@ /**

import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
const $_documentContainer = document.createElement('template');
$_documentContainer.innerHTML = `<dom-module id="vaadin-combo-box-overlay-styles" theme-for="vaadin-combo-box-overlay">
<template>
<style>
:host {
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
}
</style>
</template>
</dom-module>`;
document.head.appendChild($_documentContainer.content);
/**

@@ -32,2 +45,14 @@ * The overlay element.

connectedCallback() {
super.connectedCallback();
const dropdown = this.__dataHost;
const comboBoxOverlay = dropdown.getRootNode().host;
const comboBox = comboBoxOverlay && comboBoxOverlay.getRootNode().host;
const hostDir = comboBox && comboBox.getAttribute('dir');
if (hostDir) {
this.setAttribute('dir', hostDir);
}
}
ready() {

@@ -221,2 +246,28 @@ super.ready();

_getCustomWidth() {
return window.ShadyCSS ?
window.ShadyCSS.getComputedStyleValue(this, '--vaadin-combo-box-overlay-width') :
getComputedStyle(this).getPropertyValue('--vaadin-combo-box-overlay-width');
}
_setOverlayWidth() {
const inputWidth = this.positionTarget.clientWidth + 'px';
const customWidth = this._getCustomWidth();
if (window.ShadyCSS && !window.ShadyCSS.nativeCss) {
window.ShadyCSS.styleSubtree(this.$.overlay, {
'--vaadin-combo-box-overlay-width': customWidth,
'--_vaadin-combo-box-overlay-default-width': inputWidth
});
} else {
this.$.overlay.style.setProperty('--_vaadin-combo-box-overlay-default-width', inputWidth);
if (customWidth === '') {
this.$.overlay.style.removeProperty('--vaadin-combo-box-overlay-width');
} else {
this.$.overlay.style.setProperty('--vaadin-combo-box-overlay-width', customWidth);
}
}
}
_setPosition(e) {

@@ -247,5 +298,6 @@ if (this.hidden) {

this.$.overlay.style.width = this.positionTarget.clientWidth + 'px';
this.$.overlay.style.justifyContent = this.alignedAbove ? 'flex-end' : 'flex-start';
this._setOverlayWidth();
// TODO: fire only when position actually changes changes

@@ -252,0 +304,0 @@ this.dispatchEvent(new CustomEvent('position-changed'));

@@ -134,2 +134,7 @@ /**

}
const hostDir = this._comboBox.getAttribute('dir');
if (hostDir) {
this.setAttribute('dir', hostDir);
}
}

@@ -136,0 +141,0 @@

@@ -234,3 +234,3 @@ /**

static get version() {
return '5.2.0-alpha1';
return '5.2.0-alpha2';
}

@@ -237,0 +237,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc