jquery-magicsearch
jquery-magicsearch copied to clipboard
Multiselect Dynamic Width
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?
In the jquery.magicsearch.css file, under .magicsearch-wrapper .multi-item, set width: auto;
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
}
});