Bug explanation
Bad Dialog:

Good Dialog:

To Reproduce
This is easily one of the weirdest bugs I've ever encountered. Download my repo if you want to follow along: https://github.com/jrdnwrth/ButtonBugExample
- Enter a value into this TextBox:

- Click the "Open Buggy Dialog" button.
- You will see the Bad dialog.
- Clear the text box.
- Click the button again.
- You will see the Good dialog.
The Plot Thickens
Want to fix the bug? Change the Width of the dialog from 160 to 170. No more bugs. All fixed. I kid you not.

Also notice that Visual Studio's "UI Debugger" widget at the top of the popup disappears when it is broken:

I'm not sure what that is about.
More info
- I am seeing this bug in v4.8.0, v4.9.0, and v5.0.0 preview.
- This bug only shows up in dialog windows.
Version
4.8.0