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

Multiselect Dynamic Width #11

Open
wei opened this issue Apr 12, 2019 · 2 comments
Open

Multiselect Dynamic Width #11

wei opened this issue Apr 12, 2019 · 2 comments

Comments

@wei
Copy link

wei commented Apr 12, 2019

multi-item seems to have a fixed width, this works well for the demo where all the names are short but can dynamic(auto) widths be implemented for data sources that have variant text lengths?

image
image

@seancosgrove
Copy link

In the jquery.magicsearch.css file, under .magicsearch-wrapper .multi-item, set width: auto;

@muonsei
Copy link

muonsei commented Aug 18, 2023

I owe this to a colleague. Posting it here just in case someone needs it in the future:

$("#basic").magicsearch({
    dataSource: data,
    fields: ['field1', 'field2'],
    id: 'id',
    format: '%field1%, %field2%',
    multiple: true,
    noResult: 'No results found.',
    multiStyle: {
       width: 'auto', // Add this part
    }
});

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

3 participants