Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

Unable to resize dropdown width and unable to open dropdown after selecting an item #335

Open
stardocs-digital opened this issue Mar 24, 2018 · 1 comment

Comments

@stardocs-digital
Copy link

Hi,

I'm not sure if this is a bug or a configuration issue, but when I load the default sample of bootstrap-tokenfield on my page, the dropdown width looks like this:

screen shot 2018-03-24 at 3 15 51 pm

On the list with id "ui-id-1", there is a strange style attached to it that sets this: "min-width: 98px; position: relative; top: 314px; left: 281px; width: 1132px; display: none;"

I have tried to modify the width in the debugger tool that I have but it keeps reverting and I am unable to find out where this value is set. I am unable to change the dropdown width via css as well.

Also, when an item is added to the token list, i have to defocus and focus on the input again before the dropdown will open. Is this a by default and is there a place where I can access this?

This is such a great addition to bootstrap and thank you for your work.

@vsusloparov
Copy link

This worked for me:

el.tokenfield({
    autocomplete: {
        source: data,
        minLength: minLength,
        delay: delay,
        open: function (event, ui) {

            // make width of dropdown equals to width of input field
            var _openDD = $("ul.ui-autocomplete.ui-widget-content:visible");
            var _width = $(this).parent().width();

            _openDD.width(_width);
        }
    },
    delimiter: c_delimiter
});

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

No branches or pull requests

2 participants