Unselect points when click empty area

Based on this case
How can I remove plotly select box after the selection is done

I came up with a solution:
https://jsfiddle.net/destradafilm/7ct5kgj2/