# juce::PopupMenu not repainting correctly

**URL:** <https://forum.juce.com/t/juce-popupmenu-not-repainting-correctly/56015>\
**Category:** Audio Plugins\
**Created:** [April 30, 2023, 4:36pm UTC](https://forum.juce.com/t/juce-popupmenu-not-repainting-correctly/56015 "2023-04-30T16:36:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeloe](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zeloe/32/15551_2.png) [@zeloe](https://forum.juce.com/u/zeloe)\
**Post date:** [April 30, 2023, 4:36pm UTC](https://forum.juce.com/t/juce-popupmenu-not-repainting-correctly/56015/1 "2023-04-30T16:36:57Z")

</div>

Hi all.  
I got a popup menu with custom components.  
When the mouse gets over it should change the color of the component.  
In my custom components, i call mouseEnter, mouseMove and mouseExit.  
The issue i got is that even if i am not exiting the component in the menu mouseExit gets called.  
I am sure that i am missing something important.  
Here is a code snippet :  
void mouseEnter(const juce::MouseEvent &event) override  
{

```
    if(getLocalBounds().contains(event.getPosition()) == true)
   {
       paintColour = color;
       repaint();
       check = true;
       std::cout << check << std::endl;
      
   }
}

void mouseMove(const juce::MouseEvent &event) override
{
    if(getLocalBounds().contains(event.getPosition()) == true)
{
    paintColour = color;
    repaint();
    check = true;
    std::cout << check << std::endl;
   
}

 
}

void mouseExit(const juce::MouseEvent &event) override
{
    if(getLocalBounds().contains(event.getPosition()) == false)
    {
        paintColour = juce::Colours::grey;
        repaint();
        check = false;
        std::cout << check << std::endl;
    }
} 

```

My terminal then prints always when i enter with my mouse 1 , 1 and 0.  
Thanks in advance
