GithubHelp home page GithubHelp logo

Comments (16)

thekiharani-dev avatar thekiharani-dev commented on May 20, 2024 1

1.13.1 is not working on the first click after web page loads in bootstrap 4.1.1, what could be the issue?

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

The bower description bug will be fixed in v1.13.1. Working on recreating the second bug. Are you getting that in any other browsers, or just Safari?

from bootstrap-select-temp.

mikeploeger avatar mikeploeger commented on May 20, 2024

Yeah the same for Firefox 59.0.2 (TypeError: t.fn.dropdown.Constructor is undefined) + Chrome 65 (Uncaught TypeError: Cannot read property 'VERSION' of undefined)

If it helps, I could try code changes, if you have any suggestions.

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

Are you sure you're loading Bootstrap before bootstrap-select?

from bootstrap-select-temp.

mikeploeger avatar mikeploeger commented on May 20, 2024

Maybe helpful, Ive tried something:

Old:

version.full = ($.fn.dropdown.Constructor.VERSION || '').split(' ')[0].split('.');

New:

version.full = ('1.13.0' || '').split(' ')[0].split('.');

And its working without any errors. Maybe it is possible to rewrite just the $.fn.dropdown.Constructor.VERSION in another way?
And yes, i'am loading it as last library.

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

That line of code retrieves the Bootstrap version. If Constructor is returning undefined, it has to be an issue with the way Bootstrap is being implemented. Could you link me to a demo?

from bootstrap-select-temp.

jkrehm avatar jkrehm commented on May 20, 2024

I ran into this issue while using bootstrap-select in a React environment (no delivered Bootstrap code). We've been using bootstrap-select without issue that way until v1.13.0. I've pinned it to never go beyond 1.12.4 to resolve the issue.

I recognize that bootstrap-select has Bootstrap right in its name, but up to this point I'm unaware of dependencies between bootstrap-select and Bootstrap's JS. I've not run into any, at least.

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

Bootstrap-select depends on Bootstrap's dropdown.js, as well as some other necessary CSS. I'm planning on releasing a bundled version in the near future that would include only the necessary Bootstrap code to prevent having to load Bootstrap separately (to prevent extra bloat if you're not already using Bootstrap in your project).

I would love to get this particular issue figured out, but I need to find a way to recreate it so I can get to the bottom of it.

from bootstrap-select-temp.

mikeploeger avatar mikeploeger commented on May 20, 2024

Iam more than happy to let you know that I could fix the bug!

Like I said, 1.12.4 worked without an issue before and iam using the dropdown plugin v.3.3.7 which is inside the bootstrap.js file.

To fix the newly introduced 1.13.0 TypeError Bug I had to change the order in which the scripts are embedded inside the vendor.json.

Before (With Error):

"bower_components/bootstrap/dist/js/bootstrap.min.js",
"bower_components/bootstrap/dist/css/bootstrap.min.css",
...
"bower_components/dropdown.js/jquery.dropdown.js",
...
"bower_components/bootstrap-select/dist/js/bootstrap-select.js",

After (Wich fixes the error):

"bower_components/bootstrap/dist/js/bootstrap.min.js",
"bower_components/bootstrap/dist/css/bootstrap.min.css",
...
"bower_components/bootstrap-select/dist/js/bootstrap-select.js",
"bower_components/dropdown.js/jquery.dropdown.js",
...

So its crucual that the Bootstrap-Select.js library will be loaded BEFORE the jquery.dropdown.js library is loaded.

from bootstrap-select-temp.

mikeploeger avatar mikeploeger commented on May 20, 2024

UPDATE
I think this part of jquery.dropdown.js interferes with Bootstrap-Select Plugin:

$.fn.dropdown = function(params) {
if( typeof methods[params] == 'function' ) methodsparams;
if (methods[params]) {
return methods[params].apply(this, Array.prototype.slice.call(arguments,1));
} else if (typeof params === "object" | !params) {
return methods.init.apply(this, arguments);
} else {
$.error("Method " + params + " does not exists on jQuery.dropdown");
}
};

And after visiting the Github Repo i found that this is a bug of the jQuery.dropdown.js Plugin:
FezVrasta/dropdown.js#19

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

Ah, I see. I haven't heard of the dropdown plugin before. It was definitely interfering with Bootstrap's own dropdown.js. Is there a reason you're including both?

from bootstrap-select-temp.

mikeploeger avatar mikeploeger commented on May 20, 2024

In the end I removed the dropdownjs library from my project.
I appreciate your fast help, thanks @caseyjhol!

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

I'll go ahead and make a change in v1.13.1, so that if there are any issues detecting the version it will fall back to 3.

from bootstrap-select-temp.

caseyjhol avatar caseyjhol commented on May 20, 2024

Fixed and released in v1.13.1!

from bootstrap-select-temp.

ataft avatar ataft commented on May 20, 2024

I ran into this issue as well and 1.13.1 fixed it, but I still get the ugly console.error. Maybe it's better as a console.info until the issue is completely understood and fixed? I'm loading jQuery before Bootstrap so that bootstrap tooltip overrides jQuery's. Then, bootstrap-select is loaded after those. I have these set up as dependencies in a requirejs config...

from bootstrap-select-temp.

prateekkathal avatar prateekkathal commented on May 20, 2024

@caseyjhol Still getting this error (Click Here)

In my packages.json

    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.1.2",
        "browser-sync": "^2.24.4",
        "browser-sync-webpack-plugin": "2.0.1",
        "cross-env": "^5.1",
        "jquery": "^3.2",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.4",
        "popper.js": "^1.12",
        "vue": "^2.5.7"
    },
    "dependencies": {
        "bootstrap-select": "^1.13.1",
        "chart.js": "^2.7.2",
        "datatables.net": "^1.10.16",
        "datatables.net-bs4": "^1.10.16",
        "font-awesome": "^4.7.0",
        "gijgo": "^1.9.6"
    }

I went inside the bootstrap-select.js and it still has the old code (Check Here)

Why can't I find this commit in 1.13.1? When are you planning to merge this?

from bootstrap-select-temp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.