Modified to stop propagation of mousedown event rather than click