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

Doesn't work with jQuery 3.4.1 #384

Open
doubleaxe opened this issue Dec 16, 2019 · 0 comments
Open

Doesn't work with jQuery 3.4.1 #384

doubleaxe opened this issue Dec 16, 2019 · 0 comments

Comments

@doubleaxe
Copy link

doubleaxe commented Dec 16, 2019

After further investigation the bug appears in jQuery itself. It was introduced between 3.2.1 and 3.3.0 in January 2018 and still not fixed. This PR jquery/jquery#3887 tries to fix it, but it wasn't merged. I already 'fixed' jQuery in my code, with $.fn.position = function() {. This bug report may be closed as invalid.

The bug is reproduced, if typeahead element is inside div with position: relative. Bootstrap <div class="col-sm-12"> for example.

They modified behavior of position() function in jQuery 3.3.0 here: jquery/jquery#3107. Bootstrap-3-Typeahead relied on old position() behavior when calculating dropdown position, and now dropdown is displayed at top of window, instead of correct position. The bug is here:

        show: function() {
            var pos = $.extend({}, this.$element.position(), {
                height: this.$element[0].offsetHeight
            });

Temporary workaround is using static position, by appending dropdown to $('body'), but in this case dropdown is not scrolled with its parent element.

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

No branches or pull requests

1 participant