Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Ctrl+K doesn't focus on the user search textbox if you click home button first

Open hrabotoner opened this issue 1 year ago • 7 comments

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

  1. Press the home button
  2. Press Ctrl+K
  3. 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!

hrabotoner avatar Nov 07 '24 12:11 hrabotoner

Restart of the app fixed it somehow.

hrabotoner avatar Nov 07 '24 12:11 hrabotoner

If you press the home button and then press Ctrl+K, the issue occurs.

hrabotoner avatar Nov 07 '24 12:11 hrabotoner

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

rique223 avatar Nov 19 '24 20:11 rique223

@jeanfbrito @hrabotoner is anyone working on it , If not i did like to work on it .

saurabhraghuvanshii avatar Nov 22 '24 12:11 saurabhraghuvanshii

Can you please assign me this issue , I want to work on this !!

AryanSwaroop avatar Dec 01 '24 05:12 AryanSwaroop

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.

IITI-tushar avatar Dec 16 '24 05:12 IITI-tushar

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.

Vringe avatar Dec 17 '24 08:12 Vringe

hey @hrabotoner I just checked it on v7.2.0, an it works fine, its fixed.

ShreyTanna29 avatar Jan 01 '25 17:01 ShreyTanna29

I just had this bug with 7.6.4 again. Still can reproduce it by clicking the home icon first.

Vringe avatar Jul 29 '25 05:07 Vringe

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.

Vringe avatar Oct 28 '25 15:10 Vringe