Open mrtwebdesign opened 3 years ago
Great workaround! Worked like a charm for me
Actually one fix: If you press the first item on the list, it will return a key of 0, which JS interprets as false, so it won't run that function.
Instead, you should check if 'key' exists in option, like this:
if ('key' in option) {...}
If I close the modal with the cancel button, onCloseModal returns unexpected output. For now I'm working around it by doing something like this:
when cancel is selected, onCloseModal returns: