How to clear Plotly selection made by selection tool on click

I am trying to clear the selection made by select tool on 'plotly_click'  event by setting selectedpoints to null in Plotly.restyle.

Although it seems to work in plotly.js v1.58.5. But in plotly.js v2.17.0 it does not work.

Is this because there is any updated method to do this or is it a bug.
Below is a jsfiddle reference.

Hello @Yash_gavali,

Welcome to the community!

Just a question, but why doesnt double click serve your purpose?

@jinnyzor The double click doesn’t seem to work when done using the laptop touchpad

Check out here:

I reset the graph by using an event listener.