1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-09 05:34:05 +02:00

Fix TweetDeck bug where docked composer loses focus after Alt+Tab

Closes 
This commit is contained in:
chylex 2020-05-16 17:53:50 +02:00
parent ab91540deb
commit a0f8689d4f

View File

@ -1068,6 +1068,29 @@
});
});
//
// Block: Fix docked composer not re-focusing after Alt+Tab.
//
onAppReady.push(function fixDockedComposerRefocus(){
$(document).on("tduckOldComposerActive", function(e){
const ele = $$(".js-compose-text", ".js-docked-compose");
const node = ele[0];
let cancelBlur = false;
ele.on("blur", function(e){
cancelBlur = true;
setTimeout(function(){ cancelBlur = false; }, 0);
});
window.TDGF_prioritizeNewestEvent(node, "blur");
node.blur = prependToFunction(node.blur, function(){
return cancelBlur;
});
});
});
//
// Block: Refocus the textbox after switching accounts.
//