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

Enhance Positioning Options for Tooltips & Popovers #22264

Closed
wants to merge 2 commits into from

Conversation

IdanCo
Copy link
Contributor

@IdanCo IdanCo commented Mar 24, 2017

Summary:

Add more positioning options to the tooltip component, using tether's native attachment options. As requested in #17759 and #19921, and inspired by semantic UI tooltips. No breaking changes, still fully support previous params. Docs updated accordingly.

Before:

Tooltips supported only 4 positioning options: top | right | bottom | left

After:

Tooltips now have an optional secondary alignment option, for example top left or right bottom, summing up in 12 positioning options.

@IdanCo IdanCo changed the title Expand positioning options for tooltips Enhance Positioning Options for Tooltips Mar 24, 2017
@Johann-S
Copy link
Member

Hi @IdanCo, is it possible for you to post a JSBin with your modifications ?

@IdanCo
Copy link
Contributor Author

IdanCo commented Mar 28, 2017

sure - http://jsbin.com/lijalowata/edit?html,output

I just copied the CSS and JS from the dist folder. Hope it's ok, couldn't think of a smarter way.

@IdanCo IdanCo force-pushed the feature/tooltip_positioning branch from 1216812 to 0e30583 Compare March 28, 2017 21:00
@Johann-S
Copy link
Member

IMO this PR is good to go 👍

Any CSS feedbacks @mdo ? Or other feedbacks @bardiharborow ?

@NicoLB
Copy link
Contributor

NicoLB commented Apr 5, 2017

I think it then makes sense to also implement this on Popovers.

@IdanCo
Copy link
Contributor Author

IdanCo commented Apr 9, 2017

@NicoLB , Sounds great!
@Johann-S , should it be in the same branch or as a different PR?

@IdanCo IdanCo force-pushed the feature/tooltip_positioning branch 3 times, most recently from 67a2718 to 5a6e71a Compare April 13, 2017 13:44
top: initial;
bottom: $popover-arrow-outer-width - 1;
}
&::after {

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5

}

&-bottom {
&::before {

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5


&.bs-tether-element-attached {
&-top {
&::before,

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5

right: $popover-arrow-outer-width - 1;
}
&::after {
left: initial;

Choose a reason for hiding this comment

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

Properties should be ordered right, left

left: initial;
right: $popover-arrow-outer-width - 1;
}
&::after {

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5

right: $popover-arrow-outer-width - 1;
}
&::after {
left: initial;

Choose a reason for hiding this comment

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

Properties should be ordered right, left

left: initial;
right: $popover-arrow-outer-width - 1;
}
&::after {

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5


&-right {
&::before {
left: initial;

Choose a reason for hiding this comment

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

Properties should be ordered right, left

}

&-right {
&::before {

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5


&.bs-tether-element-attached {
&-left {
&::before,

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5

@IdanCo IdanCo force-pushed the feature/tooltip_positioning branch from 5a6e71a to d43768c Compare April 13, 2017 14:15
@IdanCo
Copy link
Contributor Author

IdanCo commented Apr 13, 2017

Added a new commit which implements the same enhancement to the popovers, namely add 8 more positions to the existing 4.

You can see it in action here - http://jsbin.com/voteco/edit?html,output

I've also updated the docs for popovers accordingly (similar to the update in tootltips) -
image

@IdanCo IdanCo changed the title Enhance Positioning Options for Tooltips Enhance Positioning Options for Tooltips & Popovers Apr 13, 2017
@Johann-S
Copy link
Member

Sorry but this PR is outdate with the merge of #22444 feel free to create a new one with Popper.js 😉

@Johann-S Johann-S closed this May 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants