Skip to content

Doesn't work with jQuery 3.4.1 #384

Description

@doubleaxe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions