diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 63cc1a2887..a06d393f0c 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -4142,6 +4142,9 @@ bool wxRichTextCtrl::SetFocusObject(wxRichTextParagraphLayoutBox* obj, bool setC wxRichTextParagraphLayoutBox* oldContainer = GetFocusObject(); bool changingContainer = (m_focusObject != obj); + if (changingContainer && HasSelection()) + SelectNone(); + m_focusObject = obj; if (!obj)