Skip to content

Dismissible alert - long text overlaps close button #24469

Closed

Description

@Kopyov

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

Activity

  1. Johann-S commented on Oct 20, 2017

    @Johann-S
    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.

  2. added
    awaiting-replyWaiting on the author; an issue closes after 14 days without reply
    cssSass sources or compiled CSS
    v4v4, the frozen docs on gh-pages
    on Oct 20, 2017
  3. Kopyov commented on Oct 20, 2017

    @Kopyov
    ContributorAuthor
  4. Johann-S commented on Oct 20, 2017

    @Johann-S
    Member

    they are no issue in your JSFiddle 😲

  5. removed
    awaiting-replyWaiting on the author; an issue closes after 14 days without reply
    on Oct 20, 2017
  6. Kopyov commented on Oct 20, 2017

    @Kopyov
    ContributorAuthor

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

  7. jipexu commented on Oct 20, 2017

    @jipexu
    Contributor

    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

  8. XhmikosR commented on Oct 20, 2017

    @XhmikosR
    Member
  9. MattJLeach commented on Oct 20, 2017

    @MattJLeach

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

  10. andresgalante commented on Oct 20, 2017

    @andresgalante
    Collaborator

    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!

  11. Kopyov commented on Oct 20, 2017

    @Kopyov
    ContributorAuthor

    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.

  12. andresgalante commented on Oct 20, 2017

    @andresgalante
    Collaborator

    @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

  13. andresgalante commented on Oct 20, 2017

    @andresgalante
    Collaborator

    @Kopyov
    alert

    .alert-dismissible {
      padding-right: ($close-font-size + $alert-padding-x);
    }
  14. Kopyov commented on Oct 20, 2017

    @Kopyov
    ContributorAuthor

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

  15. added
    has-prAn open pull request addresses it
    on Oct 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssSass sources or compiled CSShas-prAn open pull request addresses itv4v4, the frozen docs on gh-pages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions