[BUG] popup doesn't resize properly when dragged over docked window

I have a popup which opens at the cursor location and is moveable by the user.
On the popup i have just a multistate button.
It is a popup with the height of 50px.

When the user changes the state of the multi state button he is getting more options to control the machine. When he just opens the popup and start to control it everything is fine.
However when the user first change the location of the pop-up and then change the state of the multi state button then there will be a scrollbar...
Even when i set the overflow of the popup to hidden

Good scenario:

image
image

Bad scenario:


Here are the views I used:
Popup odd behaviour.zip (21.9 KB)