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

@vaadin/vaadin-list-mixin

Package Overview
Dependencies
Maintainers
16
Versions
255
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/vaadin-list-mixin - npm Package Compare versions

Comparing version 2.4.0-alpha1 to 2.4.0-alpha2

5

package.json

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

"name": "@vaadin/vaadin-list-mixin",
"version": "2.4.0-alpha1",
"version": "2.4.0-alpha2",
"main": "vaadin-list-mixin.js",

@@ -31,3 +31,4 @@ "author": "Vaadin Ltd",

"dependencies": {
"@polymer/polymer": "^3.0.0"
"@polymer/polymer": "^3.0.0",
"@vaadin/vaadin-element-mixin": "^2.3.1"
},

@@ -34,0 +35,0 @@ "devDependencies": {

32

vaadin-list-mixin.js

@@ -8,2 +8,3 @@ /**

import { DirHelper } from '@vaadin/vaadin-element-mixin/vaadin-dir-helper.js';
import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';

@@ -148,2 +149,6 @@ import { timeOut } from '@polymer/polymer/lib/utils/async.js';

get _isRTL() {
return !this._vertical && this.getAttribute('dir') === 'rtl';
}
_onKeydown(event) {

@@ -170,4 +175,3 @@ if (event.metaKey || event.ctrlKey) {

const isRTL = !this._vertical && this.getAttribute('dir') === 'rtl';
const dirIncrement = isRTL ? -1 : 1;
const dirIncrement = this._isRTL ? -1 : 1;

@@ -180,6 +184,6 @@ if (this._vertical && key === 'Up' || !this._vertical && key === 'Left') {

idx = currentIdx + dirIncrement;
} else if ((key === 'Home' && !isRTL) || (key === 'End' && isRTL)) {
} else if (key === 'Home') {
increment = 1;
idx = 0;
} else if ((key === 'End' && !isRTL) || (key === 'Home' && isRTL)) {
} else if (key === 'End') {
increment = -1;

@@ -251,3 +255,5 @@ idx = this.items.length - 1;

const props = this._vertical ? ['top', 'bottom'] : ['left', 'right'];
const props = this._vertical ? ['top', 'bottom'] :
this._isRTL ? ['right', 'left'] : ['left', 'right'];
const scrollerRect = this._scrollerElement.getBoundingClientRect();

@@ -258,5 +264,7 @@ const nextItemRect = (this.items[idx + 1] || item).getBoundingClientRect();

let scrollDistance = 0;
if (nextItemRect[props[1]] >= scrollerRect[props[1]]) {
if (!this._isRTL && nextItemRect[props[1]] >= scrollerRect[props[1]] ||
this._isRTL && nextItemRect[props[1]] <= scrollerRect[props[1]]) {
scrollDistance = nextItemRect[props[1]] - scrollerRect[props[1]];
} else if (prevItemRect[props[0]] <= scrollerRect[props[0]]) {
} else if (!this._isRTL && prevItemRect[props[0]] <= scrollerRect[props[0]] ||
this._isRTL && prevItemRect[props[0]] >= scrollerRect[props[0]]) {
scrollDistance = prevItemRect[props[0]] - scrollerRect[props[0]];

@@ -274,3 +282,11 @@ }

_scroll(pixels) {
this._scrollerElement['scroll' + (this._vertical ? 'Top' : 'Left')] += pixels;
if (this._vertical) {
this._scrollerElement['scrollTop'] += pixels;
} else {
const scrollType = DirHelper.detectScrollType();
const scrollLeft = DirHelper.getNormalizedScrollLeft(scrollType,
this.getAttribute('dir') || 'ltr', this._scrollerElement) + pixels;
DirHelper.setNormalizedScrollLeft(scrollType,
this.getAttribute('dir') || 'ltr', this._scrollerElement, scrollLeft);
}
}

@@ -277,0 +293,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