Skip to content

console error using new bootstrap 4.2.1 #27921

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

Closed
pcodedviral opened this issue Dec 25, 2018 · 10 comments
Closed

console error using new bootstrap 4.2.1 #27921

pcodedviral opened this issue Dec 25, 2018 · 10 comments

Comments

@pcodedviral
Copy link

hi sir,
i am using windows 10 in Chrome browser i will develop project with "Bootstrap 4.2.1"

when i am click on any portion of my page it will give error in console

capture

when i am use bootstrap 4.1.3 then no error will display

can you help me solve this

@XhmikosR
Copy link
Member

Bug reports must include a live demo of the issue. 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 Operating System details.

This is an automated reply

@pcodedviral
Copy link
Author

i am using windows 10 in Chrome browser

@Yusufzai
Copy link

Are you modifying your project or starting form scratch?

@pcodedviral
Copy link
Author

i am modifying my project

@pcodedviral
Copy link
Author

pcodedviral commented Dec 25, 2018

an error will occurred if i am using a dropdown in my page
the sample code will be given below

<div class="dropdown">
    <a class="dropdown-toggle" href="javascript:" data-toggle="dropdown"><i class="icon feather icon-bell"></i></a>
    <div class="dropdown-menu dropdown-menu-right notification">
        <div class="noti-head">
            <h6 class="d-inline-block m-b-0">Notifications</h6>
            <div class="float-right">
                <a href="javascript:" class="m-r-10">mark as read</a>
                <a href="javascript:">clear all</a>
            </div>
        </div>
        <ul class="noti-body">
            <li class="n-title">
                <p class="m-b-0">NEW</p>
            </li>
        </ul>
        <div class="noti-footer">
            <a href="javascript:">show all</a>
        </div>
    </div>
</div>

in the above code in anchor tag if i am used href="#!", href="javascript:" then it occur error in console

but if i am using anchor tag without href or href="#" then it will work fine.

so can you help me for solving this in bootstrap 4.1.3 it will work fine

@pcodedviral
Copy link
Author

check attached document of sample page

test.zip

@Yusufzai
Copy link

Thanks for the example. We will get back to you with the solution.

@Yusufzai
Copy link

Here is a fix for the problem.

https://codepen.io/anon/pen/JwJWBE

Let me know if this works for you

@rafalp
Copy link

rafalp commented Dec 26, 2018

I don't think that not using href= in link really counts as a fix, @Yusufzai ;)

The issue is that its pretty common pattern to have anchor open the dropdown, but also have proper href= that opens new page when user middle-clicks it.

@Johann-S
Copy link
Member

@pcodedviral you can set your href attribute to # and it'll works.

Related to: #27912

It'll be fixed in our next release

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

6 participants
@XhmikosR @rafalp @Johann-S @Yusufzai @pcodedviral and others