Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(paper-select): positioning when content is scrollable #895

Conversation

panthony
Copy link
Contributor

@panthony panthony commented Mar 9, 2018

This PRs fix #773.

The issue was that at the time where scrollHeight and offsetHeight were retrieved the container was still hidden.

Because of this both values where always 0.

Moving the statement below fixes the issue because the computePosition manually set display:block  on the container.

    // Get the selectMenuRect *after* max-width is possibly set above
    containerNode.style.display = 'block';
    let selectMenuRect = selectNode.getBoundingClientRect();
    let centeredRect = getOffsetRect(centeredNode);

@panthony panthony force-pushed the fix/paper-select-scrollable-position branch from 174767d to 5596eb7 Compare March 9, 2018 09:51
@panthony panthony changed the title Fix paper-select content positioning when scrollable paper-select: fix content positioning when scrollable Mar 9, 2018
@panthony panthony changed the title paper-select: fix content positioning when scrollable fix(paper-select): positioning when content is scrollable Mar 9, 2018
@miguelcobain miguelcobain merged commit b6234b2 into miguelcobain:master May 10, 2018
@miguelcobain
Copy link
Owner

Thanks @panthony. Nice find!

@panthony panthony deleted the fix/paper-select-scrollable-position branch May 10, 2018 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select options appear on top of screen when too many options
2 participants