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

Toast problem #27919

Closed
lcsqlpete opened this issue Dec 24, 2018 · 7 comments
Closed

Toast problem #27919

lcsqlpete opened this issue Dec 24, 2018 · 7 comments

Comments

@lcsqlpete
Copy link

lcsqlpete commented Dec 24, 2018

Using OSX 10.13.6, Chrome 71.0.3578.98 and Bootstrap 4.2.1.

Copied the code for showing a toast from the documentation along with a button to show it. I thought toasts normally displayed on top of other page elements but in my case, the toast displays below (further down the page than) the button

Here's the code.

<button type="button" class="btn" onClick="$('.toast').toast('show')">Show</button>
        <div class="toast" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="false">
            <div class="toast-header">
                <strong class="mr-auto">Toast heading</strong>
                <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="toast-body text-success">
                <p>Toast body</p>
            </div>
        </div>

I'm bringing in Bootstrap with:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>

Thanks in advance for any guidance.

@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/JS Bin or Stackblitz and report back with your link, Bootstrap version, and specific browser and OS details.

This is an automated reply

@lcsqlpete
Copy link
Author

The OS, browser, and Bootstrap versions are all in my original post.

To see a simple example of the problem, go to https://www.celticsociety.org/test/toast.html

This may not be a bug but a misunderstanding on my part.

@Johann-S
Copy link
Member

Oh ok I understand your issue !

I think our docs isn't very clear about that's your job to position your toasts, it's explained here: https://getbootstrap.com/docs/4.2/components/toasts/#placement

Maybe we should highlight that 🤔

/CC @twbs/css-review @twbs/js-review

@XhmikosR
Copy link
Member

Would mentioning it in Overview make it clearer?

@Johann-S
Copy link
Member

Yep I think it would be clearer in the overview

@lcsqlpete
Copy link
Author

lcsqlpete commented Dec 27, 2018 via email

@NourheneMbarek
Copy link

<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>
button for close toast not work , anyone can help me

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

4 participants