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

Dismissible alert - long text overlaps close button #24469

Closed
Kopyov opened this issue Oct 20, 2017 · 12 comments
Closed

Dismissible alert - long text overlaps close button #24469

Kopyov opened this issue Oct 20, 2017 · 12 comments

Comments

@Kopyov
Copy link
Contributor

Kopyov commented Oct 20, 2017

Not sure i understand why close button now has absolute positioning in Beta2, but now if text in alert is too long, it overlaps close button. I think we need to add extra right padding to dismissible alert to ensure text and button are always visible.

Image

@Johann-S
Copy link
Member

Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via CodePen or JS Bin and report back with your link, Bootstrap version, and specific browser and OS details.

@Kopyov
Copy link
Contributor Author

Kopyov commented Oct 20, 2017

Here is a fiddle - https://jsfiddle.net/ggefb28f/2/

@Johann-S
Copy link
Member

they are no issue in your JSFiddle 😲

@Kopyov
Copy link
Contributor Author

Kopyov commented Oct 20, 2017

Try to resize browser window ;-) I clearly see that text doesn't wrap when reaching the close button

@jipexu
Copy link
Contributor

jipexu commented Oct 20, 2017

Try to resize browser window ;-) I clearly see that text doesn't wrap when reaching the close button

yes true .. it's wrap but too late ....
i noticed the same behavior

@XhmikosR
Copy link
Member

@MattJLeach
Copy link

Would love to contribute to bootstrap and have submitted a PR to resolve this. #24478

@andresgalante
Copy link
Collaborator

andresgalante commented Oct 20, 2017

Yeah, we knew of this when we merged it: #23673

@Kopyov on that PR you'll also find the explanation of why the absolute position.

@MattJLeach I'll check your PR, thanks!

@Kopyov
Copy link
Contributor Author

Kopyov commented Oct 20, 2017

Quick workaround:

.alert-dismissible {
    padding-right: ($close-font-size / 2) + ($alert-padding-x * 2);
}

Not sure though if ($close-font-size / 2) is a good solution.

@andresgalante
Copy link
Collaborator

andresgalante commented Oct 20, 2017

@Kopyov you are right! we have a parent selector! That was the exact fix I had in my head. It does create a larger padding to the right, but I'd be ok with it, Do you want to PR it?
maybe ($close-font-size + $alert-padding-x) would do it, I'll test it out

@andresgalante
Copy link
Collaborator

@Kopyov
alert

.alert-dismissible {
  padding-right: ($close-font-size + $alert-padding-x);
}

@Kopyov
Copy link
Contributor Author

Kopyov commented Oct 20, 2017

@andresgalante added your version, since it saves some space 😊

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

No branches or pull requests

7 participants