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

Components: Switch the orientation of the Popover Component only if there's more space #3947

Merged
merged 1 commit into from Dec 13, 2017

Conversation

Projects
None yet
2 participants
@youknowriad
Contributor

youknowriad commented Dec 12, 2017

Sometimes on small screens popovers keep switching their orientation because there's not enough space in both directions, this PR tackes this issue by switching the direction only if there's more space than the current direction.

As a follow-up we may try to limit the height/width of the popover if the available space is not big enough.

(Pretty sure there's an issue about this bug, but can't find it)

Testing instructions

  • On a small screen
  • Open/close popovers several times, they should not change their position constantly if there's not enough space on both sides (left/right, top/bottom).

(Some popovers to try: post visibility, post schedule, inserter).

@youknowriad youknowriad self-assigned this Dec 12, 2017

@youknowriad youknowriad requested review from gziolo and aduth Dec 12, 2017

@aduth

aduth approved these changes Dec 12, 2017

This works well. Noting that on small viewports, I cannot get the sidebar popovers to display at all (unrelated to these changes).

@youknowriad youknowriad merged commit f5233db into master Dec 13, 2017

3 checks passed

codecov/project 38.28% (+0.04%) compared to 360467b
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@youknowriad youknowriad deleted the try/smarter-popover-direction-switching branch Dec 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment