Skip to content

Popup position is incorrect #98

@Helen1987

Description

@Helen1987

When popup menu is too high to be displayed at a point of mouse click, popup is displayed higher on the height of menu. outerHeight is used to calculate the height of menu when actual content is hided.
In such situation there are no guarantee that outerHeight is correct prove

The value reported by .outerHeight() is not guaranteed to be accurate when the element or its parent is hidden. To get an accurate value, ensure the element is visible before using .outerHeight()

In my case outerHeight is slightly incorrect, so position of popup menu is slightly incorrect as well. I believe, it is better to add open class first and then calculate the position:

$menu.addClass('open');
tp = this.getPosition(e, $menu);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions