Fix text editing when drawing tool is inside modal dialog

[#77905208]