rubanraj54 / vue-bootstrap4-table

Advanced table based on Vue 2 and Bootstrap 4 ⚡️
MIT License
219 stars 57 forks source link

Simple filter of type 'select', close on selection #50

Closed soongsta closed 4 years ago

soongsta commented 5 years ago

Hi @rubanraj54

This is a enhancement request. Would it be possible that after the user chooses a item from the 'select' filter, for the dropdown selection to close.

Right now, it stays open until the user clicks away.

This would apply to the 'multi' select filter as well

Cheers

rubanraj54 commented 5 years ago

Hi @soongsta

I've implemented this feature in the develop branch. Soon you will get this feature in next release.

You can control the dropdown close on selection by enabling the new option closeDropdownOnSelection in the filter configuration. By default, it is set to false. And it works for both single & multi filters.

...
{
    label: "First Name",
    name: "name.first_name",
    filter: {
        type: "select",
        placeholder: "Select first name",
        options: [],
        mode:"multi",
        closeDropdownOnSelection: true, //new option here
    }
},
...

Cheers, Ruby.

soongsta commented 5 years ago

Awesome