adopted-ember-addons / ember-paper

The Ember approach to Material Design.
https://ember-paper.netlify.app/
MIT License
888 stars 333 forks source link

Regression: paper-menu always goes down, even if it's near the bottom of the screen #1140

Closed Gaelan closed 4 years ago

Gaelan commented 4 years ago

On beta.23 and earlier, paper-menus near the bottom of the page looked like this:

Screen Shot 2020-03-23 at 4 28 35 PM

On beta.27 and later, it looked like this:

Screen Shot 2020-03-23 at 4 31 42 PM

I wasn't able to test betas 24-26 due to #1119, but beta 27's menu refactor seems to be the most likely culprit anyway.

blmundie commented 4 years ago

The issue is caused by https://github.com/miguelcobain/ember-paper/blob/f16aea61438886671c40f70059b908d1421b3aa6/addon/components/paper-menu/component.js#L151 It was switched to use clamp from utils instead of the local clamp function https://github.com/miguelcobain/ember-paper/blob/4a825067a37d0d3358e9034319c3545a7e61890f/addon/components/paper-menu.js#L12.

I already started splitting the function to a class so I could understand what it was doing before I discovered the issue. I can do a separate pull request with just adding in the clamp function for position if you prefer that to splitting it to a class.