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

Deprecation warning for mouseEnter/mouseLeave component methods #148

Open
rahulk94 opened this issue Sep 24, 2021 · 0 comments
Open

Deprecation warning for mouseEnter/mouseLeave component methods #148

rahulk94 opened this issue Sep 24, 2021 · 0 comments

Comments

@rahulk94
Copy link

rahulk94 commented Sep 24, 2021

We're using [email protected] 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}}
      >
      ...
@rahulk94 rahulk94 changed the title Deprecation warning for mouseEnter/mouseLeave/mouseMove component methods Deprecation warning for mouseEnter/mouseLeave component methods Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant