This repository was archived by the owner on May 29, 2019. It is now read-only.
fix(position): improve placing around corners #4293
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change improves corner positioning to make it more internally consistent and useful.
The current implementation of corner positioning aligns elements in a way that is less useful than it could be. For instance, passing
left
as the second position argument aligns the left edge of the target element with the left edge of the host, while passingright
aligns the left edge of the target with the right edge of the host. This behavior makes it difficult to trigger popovers on a right-aligned control. With this PR, passingright
as the second position argument will cause the right edge of the target to be aligned with the right edge of the host control; and likewise for top and bottom. Here is the plunker with the updated functionality.This change is potentially breaking, but I feel it's worth it in terms of improving the usability of positioned elements in ui-bootstrap.