CreativeIT / getmdl-select

Select for material-design-lite
http://creativeit.github.io/getmdl-select/
MIT License
301 stars 87 forks source link

How to handle events on select #50

Closed javierdelpozo closed 7 years ago

javierdelpozo commented 7 years ago

Hi!

Im using it with the rest of mdl, and i would like to know how to hanlde the select event, or if i should have to use the text input event instead? im a bit lost with the mdl event handlers.

thanks,

franckevva commented 7 years ago

Hi, @javierdelpozo You should have to use change event of the text input. Not special mdl events. Example

     var input = document.querySelector('.mdl-textfield__input');
     input.onchange = function ($e) {
        console.log('change', $e);
       // your code
    };