Results 1 to 8 of 8

Thread: Passive event listeners

  1. #1

    Default Passive event listeners

    Hi,

    there is a new feature in the DOM spec called passive event listeners that eliminates the need for scrolling to block on touch and wheel event listeners.


    Take a closer look here:

    https://github.com/WICG/EventListene...s/explainer.md


    Can we use this with Ext JS 6? Does anybody already tried it or have some experiences with this feature regarding Ext JS?

    Greetings

    Christoph

  2. #2

    Default

    Quote Originally Posted by christoph.piepka View Post
    Hi,

    there is a new feature in the DOM spec called passive event listeners that eliminates the need for scrolling to block on touch and wheel event listeners.


    Take a closer look here:

    https://github.com/WICG/EventListene...s/explainer.md


    Can we use this with Ext JS 6? Does anybody already tried it or have some experiences with this feature regarding Ext JS?

    Greetings

    Christoph
    Did you find anything?

  3. #3

    Default

    Hi,

    unfortunately I couldn't find anything.

    Any information from Sencha?

  4. #4

    Default

    Just a proof of concept because the parameter {passive: true} seems to exist only in Chrome:

    Code:
    Ext.define('Overrides.event.publisher.Dom', {
        override: 'Ext.event.publisher.Dom',
    
        addDelegatedListener: function(eventName) {
            this.delegatedListeners[eventName] = 1;
            if (eventName === 'mousewheel') {
                this.target.addEventListener(
                    eventName, this.onDelegatedEvent, {passive: true}
                );
            } else {
                this.target.addEventListener(
                    eventName, this.onDelegatedEvent, !!this.captureEvents[eventName]
                );
            }
        },
    
        addDirectListener: function (eventName, element, capture) {
            if (eventName === 'scroll') {
                element.dom.addEventListener(
                    eventName,
                    capture ? this.onDirectCaptureEvent : this.onDirectEvent,
                    {passive: true}
                );
            } else {
                element.dom.addEventListener(
                    eventName,
                    capture ? this.onDirectCaptureEvent : this.onDirectEvent,
                    capture
                );
            }
        }
    }) ;
    I wrote it for ExtJS 6.2.0.981, but probably it is a class that does not change much and works as is with other versions.

  5. #5
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    157
    Answers
    1

    Default

    On Carousel i use "touchAction" for stop Chrome warning.

    http://docs.sencha.com/extjs/6.2.1/m...fg-touchAction

  6. #6

    Default

    Quote Originally Posted by [email protected] View Post
    On Carousel i use "touchAction" for stop Chrome warning.

    http://docs.sencha.com/extjs/6.2.1/m...fg-touchAction
    How exactly? Any code snippet as how to configure it?

  7. #7
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    157
    Answers
    1

    Default

    Sure. I'm using SA 4.2.2, ExtJs 6.2.1 Modern.

    Code:
    ...
    {
                xtype: 'carousel',
                directionLock: true,
                flex: 1,
                touchAction: {
                    panY: true,
                    panX: true
                },
                layout: 'vbox',
                items: [
    ...

  8. #8

    Default

    Thanks! Sadly in classic seems not to work

Similar Threads

  1. Event Listeners
    By Bleak in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 26 Jan 2010, 12:09 PM
  2. 2-x listeners on the same event
    By tobiu in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 15 Dec 2009, 4:58 AM
  3. Passive tab activation
    By Spock in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 28 Sep 2009, 7:25 AM
  4. Ext.Event static listeners[] slows down listeners removal
    By gbulfon in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 31 Aug 2009, 7:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •