Ctrl+K doesn't focus on the user search textbox if you click home button first
Search before asking
- [X] I had searched in the issues and found no similar issues.
Operating System
- [ ] macOS
- [ ] Windows
- [X] Linux
Operating System Version
Linux Mint 21.3
It happens on the web browser too?
Yes
Rocket.Chat Desktop App Version
4.1.1
Rocket.Chat Server Version
6.12.1
Describe the bug
When you press Ctrl+K in the Flatpak desktop app, or in the web browser version, it doesn't focus onto the user search textbox if you pressed home button beforehand. You have to click it manually.
How to Reproduce
- Press the home button
- Press
Ctrl+K - you can't start typing user search right away
Describe your Expected behavior
Should focus the textbox automatically
Anything else
always occurs
Are you willing to submit a code contribution?
- [ ] Yes, I am willing to submit a Pull Request!
Restart of the app fixed it somehow.
If you press the home button and then press Ctrl+K, the issue occurs.
Hey @hrabotoner, thank you so much for your contribution. The hotkey handling is done in Rocket.Chat's main code and not on electron. So you should send this issue to https://github.com/RocketChat/Rocket.Chat/issues
@jeanfbrito @hrabotoner is anyone working on it , If not i did like to work on it .
Can you please assign me this issue , I want to work on this !!
Hi, I couldn’t reproduce this issue in the browser, so it seems like it might have already been fixed there.
I did, however, find a similar issue in Electron: #2653. This issue also appears to be resolved in the updated server version.
I can still reproduce it in 6.13.1. What version have you tried, @IITI-tushar ?
In my case, it happens in the browser and the electron app.
hey @hrabotoner I just checked it on v7.2.0, an it works fine, its fixed.
I just had this bug with 7.6.4 again. Still can reproduce it by clicking the home icon first.
If anyone wants a quick and dirty solution: Workspace -> Settings -> Layout -> Custom Scripts -> Custom Script for Logged In Users:
document.addEventListener('keydown', function(event) {
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
if (
(isMac && event.metaKey && event.key.toLowerCase() === 'k') ||
(!isMac && event.ctrlKey && event.key.toLowerCase() === 'k')
) {
event.preventDefault();
setTimeout(() => document.querySelector('input[role="searchbox"]').focus(), 100)
}
});
Not a long-term solution but it does the job until this gets fixed properly.