TextInput loses focus in pluginType dock
I have created a dock plugin with a TextInput for user input. When I initially open the plugin, I can freely type in the text box. However, when I click anywhere outside the plugin dock area, such as on a note in the score, I cannot focus back on the TextInput. The cursor will not show up. If however, I minimize MuseScore or click outside the entire MuseScore window, onto say my internet browser, then I can return back to the plugin and click on the TextInput. Also, if I undock the plugin, I can click outside the plugin and return focus back to the TextInput without any probelm.
How do I return focus back to the TextInput after clicking outside my docked plugin? Is this a QML thing or a MuseScore issue?
Here is a modification of the panel plugin you may use to test this issue yourself:
import QtQuick 2.0 import MuseScore 1.0 MuseScore { menuPath: "Plugins.panelTextInput" version: "1.0" description: "This demo plugin creates a GUI panel with a TextInput." requiresScore: false pluginType: "dock" dockArea: "left" onRun: console.log("hello panel"); Rectangle { width: 150 height: 75 border.width: 1 TextInput { id: textInput1 anchors.fill: parent text: "Type Here" } } }
Thank you for your help.
Comments
Add
focus: true
Right before TextInput { line