fix #1076 onblur called too often by MAC

onblur custom event is called every time an element inside the MAC is blurred.
Same thing happens for the onfocus custom event.