kayvanbree / contexr

Stop redundantly defining your shortcuts in your shortcut library and your context menu. Start using Contexr!
MIT License
4 stars 0 forks source link

Context menus appearing outside of the page #6

Closed kayvanbree closed 2 months ago

kayvanbree commented 5 years ago

At this moment, the context menu can appear outside of the page. We should use the Angular Material + its position strategy to place it on the correct place on the page, respecting boundaries.

https://material.angular.io/cdk/overlay/overview

kayvanbree commented 5 years ago

Context menu placement is also buggy, see #14.

kayvanbree commented 5 years ago

We could use component injection like shown here to inject into the body instead of having to declare it manually.

kayvanbree commented 5 years ago

We can even inject it next to the clicked element and use a position strategy.

kayvanbree commented 5 years ago

We can use dependency injection in the ctx directive to get access to the ViewContainerRef to use as a host for dynamic injection. https://stackoverflow.com/a/51729364/982517

kayvanbree commented 5 years ago

https://blog.thoughtram.io/angular/2017/11/20/custom-overlays-with-angulars-cdk.html#position-strategy

kayvanbree commented 2 months ago

Fixed with the update to Angular 18