kybishop / ember-popper

Popper.js for Ember
MIT License
39 stars 35 forks source link

use `ref` modifier is not compatible with ember lifecyle #126

Closed houfeng0923 closed 4 years ago

houfeng0923 commented 4 years ago

ember-popper component is ember component and use didRender, ref modifier is not expected work usually, component only set ref dom Node after didRender, not the dom inserted .

so, when didRender execute in https://github.com/kybishop/ember-popper/blob/master/addon/components/ember-popper-base.js#L163 , _popperElement is undefined , if we use #in-element (for example tooltip ui), it will show in a default position (maybe the top left corner), after ref modifier install , _popperElement set run , it relocation to right position.

the old version https://github.com/kybishop/ember-popper/blob/v0.9.2/addon/components/ember-popper-base.js#L272 is work well

richard-viney commented 4 years ago

I've encountered what I believe is the same issue, albeit showing up in a slightly different scenario.

Here's a PR that fixes the problem: #127