# Setting selectedPoints won't let you double click to deselect the points

**URL:** <https://community.plotly.com/t/setting-selectedpoints-wont-let-you-double-click-to-deselect-the-points/66390>\
**Category:** Dash Python\
**Tags:** question, bug-reporter\
**Created:** [July 24, 2022, 7:51pm UTC](https://community.plotly.com/t/setting-selectedpoints-wont-let-you-double-click-to-deselect-the-points/66390 "2022-07-24T19:51:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/matan/32/20091_2.png) [@Matan](https://community.plotly.com/u/Matan)\
**Post date:** [July 24, 2022, 7:51pm UTC](https://community.plotly.com/t/setting-selectedpoints-wont-let-you-double-click-to-deselect-the-points/66390/1 "2022-07-24T19:51:41Z")

</div>

Long story short, I have a situation where I build the graph again in a callback with the active selected points:

```auto
import plotly.graph_objects as go

def horizontal_bar_chart(values, categories, title=None, selected_points=None):
    fig = go.Figure(
        go.Bar(
            x=values,
            y=categories,
            orientation='h',
            selectedpoints=selected_points
        )        
    )
    fig.update_layout(
        plot_bgcolor="#fff",
        paper_bgcolor="#fff",
        margin={"t": 30, "b": 0, "r": 20, "l": 0, "pad": 0},
        title_text = title,
        transition={
            'duration': 500,
            'easing': 'cubic-in-out'
        }
    )
    fig.update_yaxes(title_text='outcome')
    return fig

```

Now, if I have selected points it will show those points(bars in my case) selected after building the graph, but! it won’t let me double-click to deselect those points.

Is this a bug or am I setting the points wrong?

---

<div class="post-metadata">

**Author:** ![Matan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/matan/32/20091_2.png) [@Matan](https://community.plotly.com/u/Matan)\
**Post date:** [July 26, 2022, 11:11am UTC](https://community.plotly.com/t/setting-selectedpoints-wont-let-you-double-click-to-deselect-the-points/66390/2 "2022-07-26T11:11:20Z")

</div>

Hey guys, has Anyone got an answer to this?  
i am wondering if this is a bug or something I am doing wrong can’t figure this one out.

---

<div class="post-metadata">

**Author:** ![olyabr](https://avatars.discourse-cdn.com/v4/letter/o/ed655f/32.png) [@olyabr](https://community.plotly.com/u/olyabr)\
**Post date:** [September 2, 2022, 3:13pm UTC](https://community.plotly.com/t/setting-selectedpoints-wont-let-you-double-click-to-deselect-the-points/66390/3 "2022-09-02T15:13:24Z")

</div>

I have the same issue with my Scatter plot in the dash plotly app. Selected points are not released with a double click, although I specified this explicitly

dcc.Graph(id = ‘map’,  
figure = fig,  
hoverData=None,  
clickData = None,  
config={  
‘staticPlot’: False, # True, False  
‘scrollZoom’: True, # True, False  
‘doubleClick’: ‘reset’, # ‘reset’, ‘autosize’ or ‘reset+autosize’, False  
‘showTips’: False, # True, False  
‘displayModeBar’: True, # True, False, ‘hover’  
‘watermark’: False,  
‘modeBarButtonsToAdd’:[‘drawline’,  
‘drawopenpath’,  
‘drawclosedpath’,  
‘drawcircle’,  
‘drawrect’,  
‘eraseshape’  
]  
#‘modeBarButtonsToRemove’: [‘pan2d’,‘select2d’],  
},)

Any help will be much appreciated
