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(ui5-popover): set fallback placement when no place to popup #1467

Merged
merged 3 commits into from
Apr 13, 2020

Conversation

ilhan007
Copy link
Member

@ilhan007 ilhan007 commented Apr 13, 2020

Issue
When the opener element is taking full width and the placement is set to "Right" (same for "Left"), the popover tried to open on the opposite side, but both sides are not possible and the popover remains cut off with only its arrow visible.

Solution
Now, it checks "Bottom" and "Top" sides as well.

Note1: The fallback is applied before the allow-target-overlap to be taken into account, which means that Popover with placement "Right" or "Left", will try to open on all sides, before overlapping its target.

Note2: The fallback is used currently for "Left" and "Right' only for two reasons: (1) it fixes the issue that was originally reported by the MDK colleagues and (2) all the components, that use popover internally (f.e DatePicker) have placement="Bottom" and the change would have bigger impact, that I would avoid before release.

Note3:
The full solution is to have this fallback for all sides + placement type "Auto" that should be the default value and would try to open on "Right" first.

Fixes: #1395

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it, works great

@ilhan007 ilhan007 merged commit cfeed00 into master Apr 13, 2020
@ilhan007 ilhan007 deleted the fix-popover-placement branch April 13, 2020 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui5-popover: does not reposition itself when no place to be displayed
2 participants