diff --git a/modules/juce_gui_basics/widgets/juce_Slider.cpp b/modules/juce_gui_basics/widgets/juce_Slider.cpp index a8f37bc608..36ffd10da4 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.cpp +++ b/modules/juce_gui_basics/widgets/juce_Slider.cpp @@ -980,6 +980,11 @@ public: { popupDisplay = new PopupDisplayComponent (owner); + if (parentForPopupDisplay != nullptr) + parentForPopupDisplay->addChildComponent (popupDisplay); + else + popupDisplay->addToDesktop (ComponentPeer::windowIsTemporary); + if (style == SliderStyle::TwoValueHorizontal || style == SliderStyle::TwoValueVertical) { @@ -991,11 +996,6 @@ public: updatePopupDisplay (getValue()); } - if (parentForPopupDisplay != nullptr) - parentForPopupDisplay->addChildComponent (popupDisplay); - else - popupDisplay->addToDesktop (ComponentPeer::windowIsTemporary); - popupDisplay->setVisible (true); } }