# Cannot disable hover without killing mouse click events

**URL:** <https://community.plotly.com/t/cannot-disable-hover-without-killing-mouse-click-events/74008>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [March 31, 2023, 1:50am UTC](https://community.plotly.com/t/cannot-disable-hover-without-killing-mouse-click-events/74008 "2023-03-31T01:50:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlorinAndrei](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/florinandrei/32/10875_2.png) [@FlorinAndrei](https://community.plotly.com/u/FlorinAndrei)\
**Post date:** [March 31, 2023, 1:50am UTC](https://community.plotly.com/t/cannot-disable-hover-without-killing-mouse-click-events/74008/1 "2023-03-31T01:50:17Z")

</div>

Plotly 5.14.0, Python 3.10.6, Ubuntu 22.04, running in Jupyter Notebook

I am following the example described here:

> **[How to build a custom labeler in python with ipywidgets and plotly](https://towardsdatascience.com/how-to-build-a-custom-labeler-in-python-with-ipywidgets-and-plotly-f6cc1fd7e3cc)**
>
> Did you know that you can turn a simple Jupyter Notebook into a powerful labeler in a few line of codes ?

> **[GitHub - jkaub/segmentation-widget: This repo propose an interactive widget...](https://github.com/jkaub/segmentation-widget)**
>
> This repo propose an interactive widget to to image segmentation - GitHub - jkaub/segmentation-widget: This repo propose an interactive widget to to image segmentation

When I click on the image, I need to capture the coordinates of the click and use them in the app. I have `.on_click(self.click_handler)` set on the figure, it gets the mouse click events. That works well. But the hover pop-up follows the mouse, I do not need it, and it’s quite annoying because it covers the part of the image I need to see (right under the mouse). I’ve tried to disable it but nothing seems to work.

Here’s an example that’s equivalent to my code:

```python
import plotly.graph_objects as go
import plotly.express as px

zzz = go.FigureWidget()
zzz_trace = px.imshow(np.zeros((100, 100), dtype=np.uint8)).data[0]
zzz.add_trace(zzz_trace)
zzz.update_traces(hoverinfo="none")
# zzz.update_traces(hovertemplate=[])
zzz

```

`hoverinfo="none"` or `hoverinfo="skip"` do not disable the pop-up.

`hovertemplate=[]` disables the pop-up, but also kills the mouse click event capturing. The widget does not react to mouse clicks anymore.

This is how the pop-up looks like:

 ![hover](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/9/c/9cf49adf678e959f8408a040662a4f347aaf26a2.png)

How do I kill the popup without disabling click event tracing?

---

<div class="post-metadata">

**Author:** ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)\
**Post date:** [March 31, 2023, 1:45pm UTC](https://community.plotly.com/t/cannot-disable-hover-without-killing-mouse-click-events/74008/2 "2023-03-31T13:45:02Z")

</div>

hi @FlorinAndrei  
Welcome back to the forum.

What if you replace `zzz.update_traces(hoverinfo="none")`

with `zzz.update_layout(hovermode=False)` .

Does that also kill the mouse click event capturing?

---

<div class="post-metadata">

**Author:** ![FlorinAndrei](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/florinandrei/32/10875_2.png) [@FlorinAndrei](https://community.plotly.com/u/FlorinAndrei)\
**Post date:** [March 31, 2023, 6:43pm UTC](https://community.plotly.com/t/cannot-disable-hover-without-killing-mouse-click-events/74008/3 "2023-03-31T18:43:02Z")

</div>

@adamschroeder Yes, unfortunately that also kills the mouse click event capturing.

It’s like the control I have over this thing is not fine-grained enough, if that makes sense.
