Skip to content

Commit

Permalink
Fix dropdown positioning again
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Sep 28, 2023
1 parent bfd9ac6 commit ee1572a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion panel/dist/js/index.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions panel/src/components/Dropdowns/DropdownContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ export default {
// Horizontal: check if dropdown is outside of viewport
// and adapt alignment if necessary
if (this.axis.x === "end") {
if (rect.left - rect.width < safeSpace) {
if (opener.left - rect.width < safeSpace) {
this.axis.x = "start";
}
} else if (
rect.left + rect.width > window.innerWidth - safeSpace &&
opener.left + rect.width > window.innerWidth - safeSpace &&
rect.width + safeSpace < rect.left
) {
this.axis.x = "end";
Expand Down

0 comments on commit ee1572a

Please sign in to comment.