How to use the @material/dom/events.applyPassive function in @material/dom

To help you get started, we’ve selected a few @material/dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github material-components / material-components-web / packages / mdc-slider / component.ts View on Github external
      deregisterInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler, applyPassive()),
      registerThumbContainerInteractionHandler: (evtType, handler) => {
github pgbross / vue-material-adapter / packages / mcwv-slider / slider.js View on Github external
deregisterInteractionHandler: (type, handler) => {
        this.$el.removeEventListener(type, handler, applyPassive());
      },
      registerThumbContainerInteractionHandler: (type, handler) => {
github pgbross / vue-material-adapter / packages / mcwv-slider / slider.js View on Github external
registerThumbContainerInteractionHandler: (type, handler) => {
        this.$refs.thumbContainer.addEventListener(
          type,
          handler,
          applyPassive(),
        );
      },
      deregisterThumbContainerInteractionHandler: (type, handler) => {
github material-components / material-components-web / packages / mdc-switch / component.ts View on Github external
registerInteractionHandler: (evtType: EventType, handler: EventListener) => {
        this.nativeControl_.addEventListener(evtType, handler, applyPassive());
      },
      removeClass: (className: string) => rippleSurface.classList.remove(className),
github material-components / material-components-web-components / packages / dialog / src / mwc-dialog-base.ts View on Github external
this.mdcFoundation) as EventListener;
    this.boundLayout = () => {
      if (this.open) {
        this.mdcFoundation.layout.bind(this.mdcFoundation);
      }
    };
    this.boundHandleKeydown = this.mdcFoundation.handleKeydown.bind(
                                  this.mdcFoundation) as EventListener;
    this.boundHandleDocumentKeydown =
        this.mdcFoundation.handleDocumentKeydown.bind(this.mdcFoundation) as
        EventListener;

    this.mdcRoot.addEventListener('click', this.boundHandleClick);
    window.addEventListener('resize', this.boundLayout, applyPassive());
    window.addEventListener(
        'orientationchange', this.boundLayout, applyPassive());
    this.addEventListener('keydown', this.boundHandleKeydown, applyPassive());
    document.addEventListener(
        'keydown', this.boundHandleDocumentKeydown, applyPassive());
  }
github pgbross / vue-material-adapter / packages / mcwv-ripple / ripple-base.js View on Github external
deregisterDocumentInteractionHandler: (evtType, handler) =>
        document.documentElement.removeEventListener(
          evtType,
          handler,
          applyPassive(),
        ),
      deregisterInteractionHandler: (evt, handler) => {
github SpringflowNL / aurelia-mdc-elements / node_modules / @material / slider / component.js View on Github external
registerThumbContainerInteractionHandler: function (evtType, handler) {
                _this.thumbContainer_.addEventListener(evtType, handler, applyPassive());
            },
            deregisterThumbContainerInteractionHandler: function (evtType, handler) {
github pgbross / vue-material-adapter / packages / mcwv-textfield / textfield.js View on Github external
deregisterInputInteractionHandler: (evtType, handler) => {
          this.$refs.input.removeEventListener(
            evtType,
            handler,
            applyPassive(),
          );
        },
        getNativeInput: () => {
github material-components / material-components-web / packages / mdc-tab-scroller / component.ts View on Github external
destroy() {
    super.destroy();

    this.area_.removeEventListener('wheel', this.handleInteraction_, applyPassive());
    this.area_.removeEventListener('touchstart', this.handleInteraction_, applyPassive());
    this.area_.removeEventListener('pointerdown', this.handleInteraction_, applyPassive());
    this.area_.removeEventListener('mousedown', this.handleInteraction_, applyPassive());
    this.area_.removeEventListener('keydown', this.handleInteraction_, applyPassive());
    this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);
  }
github SpringflowNL / aurelia-mdc-elements / node_modules / @material / checkbox / component.js View on Github external
        var adapter = tslib_1.__assign({}, MDCRipple.createAdapter(this), { deregisterInteractionHandler: function (evtType, handler) { return _this.nativeControl_.removeEventListener(evtType, handler, applyPassive()); }, isSurfaceActive: function () { return matches(_this.nativeControl_, ':active'); }, isUnbounded: function () { return true; }, registerInteractionHandler: function (evtType, handler) { return _this.nativeControl_.addEventListener(evtType, handler, applyPassive()); } });
        return new MDCRipple(this.root_, new MDCRippleFoundation(adapter));

@material/dom

DOM manipulation utilities for Material Components for the web

MIT
Latest version published 3 years ago

Package Health Score

85 / 100
Full package analysis

Similar packages