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

Dropdown list not shown in Bootstrap Modal #53

Open
Micsou opened this issue Jul 21, 2017 · 3 comments
Open

Dropdown list not shown in Bootstrap Modal #53

Micsou opened this issue Jul 21, 2017 · 3 comments

Comments

@Micsou
Copy link

Micsou commented Jul 21, 2017

Hi,
I've just installed javascript.js in an app and had a problem displying the dropdown list in a Bootstrap Modal.
When initializing dropdown style, width and position were set to 0 in _Position function.
Finally i've added a line for resetting the style after loading items on line 430 in _Render function.

_Render: function (response) {
        var ul;
        if (typeof response == "string") {
            ul = this._RenderRaw(response);
        }
        else {
            ul = this._RenderResponseItems(response);
        }
        if (this.DOMResults.hasChildNodes()) {
            this.DOMResults.removeChild(this.DOMResults.childNodes[0]);
        }
        this.DOMResults.appendChild(ul);
        this.DOMResults.setAttribute("style", "top:" + (this.Input.offsetTop + this.Input.offsetHeight) + "px;left:" + this.Input.offsetLeft + "px;width:" + this.Input.clientWidth + "px;");
    },

Seems to work well.
Don't know if that trick can help... hope so..

@artemsky
Copy link

artemsky commented Aug 9, 2017

same here just in bootstrap modal with default styles

@baptistedonaux
Copy link
Contributor

@Micsou Thank you for this tricks. Do you have try to generate new position ?

var event = new Event('position');
document.querySelector("[data-autocomplete]").dispatchEvent(event);

@claudep
Copy link

claudep commented Jan 8, 2019

Currently affected by this same issue. Any help for a no JS expert?

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