Topic: Problems with onclick event in comboBox (Select)
Hello, I am initializing a combo via js (new mdb.Select(this.$myWidget);) and I need to control the onclick event. I have tried the following way: this.$myWidget.on('click', function (event) {...
and the event does not fire. How can I control the onclick event of the select component?.
Kamila Pieńkowska staff answered a year ago
You can use the events we provide. For example open.mdb.select
that is triggered after click but before select is open.
const mySelect = document.getElementById('mySelect')
mySelect.addEventListener('open.mdb.select', (e) => {
// do something...
})
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.4.1
- Device: All
- Browser: All
- OS: Windows
- Provided sample code: No
- Provided link: No