Answer the question
In order to leave comments, you need to log in
Why does the first click on a button fire twice in UIkit?
If the button is wrapped in a Div with attribute data-uk-button-checkbox
or data-uk-button-radio
then it fires twice on the first click.
Here is an example:
https://jsfiddle.net/wyj6wp0r/
Tell me why? And how to avoid it?
Answer the question
In order to leave comments, you need to log in
Tired of looking for a stable solution. Excluded attributes from div data-uk-button-checkbox
and data-uk-button-radio
organized their logic in JS. On click, I add or remove a class uk-active
and everything works like clockwork.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question