zefoy / ngx-color-picker

Color picker widget for the Angular (version 2 and newer)
MIT License
454 stars 142 forks source link

fix: place dialog within screen bounds after calculating the position… #333

Closed Kailijan closed 1 year ago

Kailijan commented 1 year ago

This should fix the issue #331 (as introduced by #329) by moving the repositioning after the initial calculation.

Additionally, I reset the values of this.arrowTop and this.cpArrowPosition to avoid misplacement of the arrow when this.cpPosition changes on a subsequent call.

I also changed the if-else to a switch-case for a better readability.

Closes #331