Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Deprecation warning for mouseEnter/mouseLeave component methods #148

@rahulk94

Description

@rahulk94

We're using ember-cli-swiper@1.0.5 in our EmberJS 3.24 application and are seeing the following deprecation warnings when using @mouseEnter and @mouseLeave attributes.

DEPRECATION: <my-app@component:swiper-container::ember2737>: Using `mouseEnter` event handler methods in components has been deprecated. [deprecation id: ember-views.event-dispatcher.mouseenter-leave-move] See https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move for more details.
        at logDeprecationStackTrace (http://localhost:4200/assets/vendor.js:43287:21)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:43314:9)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at handleDeprecationWorkflow (http://localhost:4200/assets/vendor.js:73069:9)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at deprecationCollector (http://localhost:4200/assets/vendor.js:73104:5)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at invoke (http://localhost:4200/assets/vendor.js:43432:9)

DEPRECATION: <my-app@component:swiper-container::ember2737>: Using `mouseLeave` event handler methods in components has been deprecated. [deprecation id: ember-views.event-dispatcher.mouseenter-leave-move] See https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move for more details.
        at logDeprecationStackTrace (http://localhost:4200/assets/vendor.js:43287:21)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:43314:9)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at handleDeprecationWorkflow (http://localhost:4200/assets/vendor.js:73069:9)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at deprecationCollector (http://localhost:4200/assets/vendor.js:73104:5)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:43420:9)
        at invoke (http://localhost:4200/assets/vendor.js:43432:9)

These deprecation warnings were added in Ember 3.13. See https://deprecations.emberjs.com/v3.x/#toc_component-mouseenter-leave-move for more information.

In order to get around these deprecation warnings you should instead use the on modifier for these callbacks e.g.

      <SwiperContainer
        @options={{this.swiperOptions}}
        @registerAs={{this.carousel}}
        {{on "mouseenter" this.doThingOnEnter}}
        {{on "mouseleave" this.doThingOnLeave}}
      >
      ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions