mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.34k stars 1.15k forks source link

Modal window long select. #180

Closed a1keen closed 5 years ago

a1keen commented 6 years ago

Expected behavior

Closing the selector after selecting a specific option.

Actual behavior

The selector does not close when an option is selected.

Your working environment and MDB version information

Free 4.5.7.

Resources (screenshots, code snippets etc.)

Code: https://pastebin.com/EmTeHEdZ

JStrebeyko commented 6 years ago

Hi there,

This and some other reasons made us rewrite the select from scratch. It should be out at the beginning of next week, so keep your eyes peeled.

Best, Kuba

a1keen commented 6 years ago

How can I now change that it works, maybe there is some crutch

catchmareck commented 6 years ago

Hi @GoochWeb,

As a temporary workaround, you can do something like this:

$('.z3a').on('change', function(){

    $(this).siblings('input.mdb-select').trigger('close');
});

This short code should close the dropdown on the value change.

As soon as the new material select will be released, this code won't be needed anymore

a1keen commented 6 years ago

This temporary solution closes and multi-select, how to fix code, so that this does not happen

catchmareck commented 6 years ago

You have to modify the selector to something like this:

$(".mdb-select:not([multiple])")