Closed zontafil closed 1 year ago
I solved by adding a delay in the onExpandedChanged
function:
timer.setTimeout(function(){
gptWebView.forceActiveFocus();
gptWebView.focus=true;
gptWebView.runJavaScript("document.userScripts.setInputFocus();");
}, 100);
where timer is:
Timer {
id: timer
function setTimeout(cb, delayTime) {
timer.interval = delayTime;
timer.repeat = false;
timer.triggered.connect(cb);
timer.triggered.connect(function release () {
timer.triggered.disconnect(cb); // This is important
timer.triggered.disconnect(release); // This is important as well
});
timer.start();
}
}
not sure if it's a good way as it's the first time that I write some lines of code in QML, but to me it's satisfactory
Where exactly did you put these lines of code?
@zontafil Great I`ll add it as a configable work around i didn't wanted to use a timeout method as it provide incositant results.
but you are right it better that it will mostly work then not at all :)
Thank you :+1:
Commited workaround in : https://github.com/dark-eye/com.darkeye.chatGPT/commit/3619e53d3f40f86f8d6477f02a42685b9d2479e1
Thanks @zontafil
Hello,
thank you very much for this extension. I've noticed that when I activate the applet with a keyboard shortcut, the textbox is not automatically in focus, so I need to select it with the mouse before typing anything. This doesn't happen when activating the applet by clicking on it with the mouse.