Made a range of rtl fixes

Mostly around dropdowns and other items that had right/left specific
styling.
For #3702
This commit is contained in:
Dan Brown
2022-09-06 21:30:28 +01:00
parent 623ccd4cfa
commit 98aed794cc
4 changed files with 13 additions and 9 deletions

View File

@ -37,12 +37,8 @@ class DropDown {
if (this.moveMenu) {
this.body.appendChild(this.menu);
this.menu.style.position = 'fixed';
if (this.direction === 'right') {
this.menu.style.right = `${(menuOriginalRect.right - menuOriginalRect.width)}px`;
} else {
this.menu.style.left = `${menuOriginalRect.left}px`;
}
this.menu.style.width = `${menuOriginalRect.width}px`;
this.menu.style.left = `${menuOriginalRect.left}px`;
heightOffset = dropUpwards ? (window.innerHeight - menuOriginalRect.top - toggleHeight / 2) : menuOriginalRect.top;
}
@ -94,6 +90,7 @@ class DropDown {
this.menu.style.position = '';
this.menu.style[this.direction] = '';
this.menu.style.width = '';
this.menu.style.left = '';
this.container.appendChild(this.menu);
}