1.1.3 • Published 4 years ago
@advanced-rest-client/arc-scroll-target-mixin v1.1.3
DEPRECATED
Use the @anypoint-web-components/awc module instead.
This mixin is a port of iron-overlay-behavior that works with LitElement.
ArcScrollTargetMixin allows an element to respond to scroll events from a designated scroll target.
Elements that consume this mixin can override the _scrollHandler
method to add logic on the scroll event.
Installation
npm i @advanced-rest-client/arc-scroll-target-mixinUsage
import { LitElement } from 'lit-element';
import { ArcScrollTargetMixin } from '@advanced-rest-client/arc-scroll-target-mixin/arc-scroll-target-mixin.js';
class ArcScrollTargetImpl extends ArcScrollTargetMixin(LitElement) {
static get properties() {
const top = super.properties || {};
const props = {
myProp: { type: String }
}
return Object.assign({}, top, props);
}
_scrollHandler(e) {
...
}
}Note, You need to include properties from the mixin manually as simple class
extension overrides properties.
Testing
npm run testTesting with Sauce Labs
npm run test:slDemo
npm start