Move code to make sure a clean-up happens on each run.
This commit is contained in:
@ -21,6 +21,10 @@ export const Position = function(superClass) {
|
||||
el.style.position = 'fixed';
|
||||
el.style.zIndex = 1001;
|
||||
|
||||
// Reset max-height and overflow in case the element has been positioned before.
|
||||
el.style.maxHeight = '';
|
||||
el.style.overflowY = '';
|
||||
|
||||
// Test if the target is in a different stacking context.
|
||||
el.style.left = '0px';
|
||||
el.style.top = '0px';
|
||||
@ -85,10 +89,6 @@ export const Position = function(superClass) {
|
||||
if (elRect.height > availableHeight) {
|
||||
el.style.maxHeight = availableHeight + 'px';
|
||||
el.style.overflowY = 'auto';
|
||||
} else {
|
||||
// Reset max-height if element fits
|
||||
el.style.maxHeight = '';
|
||||
el.style.overflowY = '';
|
||||
}
|
||||
|
||||
el.style.top = (top - fixTop) + 'px';
|
||||
|
Reference in New Issue
Block a user