Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically focus on search input #13

Open
Tuhljin opened this issue Nov 4, 2017 · 17 comments
Open

Automatically focus on search input #13

Tuhljin opened this issue Nov 4, 2017 · 17 comments

Comments

@Tuhljin
Copy link

Tuhljin commented Nov 4, 2017

I suggest that when the extension icon/button is clicked or the keyboard shortcut is pressed, the "Search for a tab..." input field should immediately be given focus. That way, the user can start typing their query right away.

It's particularly troublesome to have to click on something after using the keyboard shortcut. That defeats the purpose of having such a shortcut to begin with, in my opinion.

(This is aggravated by the fact that the current shortcut, Ctrl+Shift+L, is difficult to activate using only the left hand, so I move my right hand from the mouse to the keyboard to press it, then back to the mouse to move the cursor and click the "Search for a tab..." input, and then back to the keyboard to type. As is, it's often faster to not use the shortcut at all. As a side note, it'd be great to be able to set our own shortcuts. I'd also suggest a default shortcut of Ctrl+Shift+F since it can be done easily enough with just the left hand.)

@reblws reblws added the bug label Nov 5, 2017
@reblws
Copy link
Owner

reblws commented Nov 5, 2017

Hmm the issue with the input not focusing on a click is actually an FF bug, another user pointed this out in #3.

The input should be automatically focusing if you hit the keyboard shortcuts. I used to have a timeout set so the input would focus properly, but I removed it in 0.3.0 because of a change in how I initialized the popup window. Since it's an issue again I'll reinstate the focus timeout so the input focuses properly. I'll push out an update tonight fixing this. (To be honest I don't really understand why the input doesn't focus if a sufficient timeout hasn't been set)

As for customizing the shortcut, I feel your pain. There's an ongoing issue in #2 regarding this. Long story short, we just have to wait for the Firefox devs to implement custom shortcuts for WebExtensions. In the meantime I'll switch the default shortcut to Ctrl+E since it doesn't seem like many people like the current shortcut (although I really like the current shortcut, the idea is to get your hands ready for typing).

@Tuhljin
Copy link
Author

Tuhljin commented Nov 5, 2017

Ctrl+E is already a default shortcut, used by FF and other browsers to select the search bar.

@reblws
Copy link
Owner

reblws commented Nov 5, 2017

Hmm tried it out in my browser and it states here Ctrl+K and Ctrl+J focus the search bar: https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly

@reblws
Copy link
Owner

reblws commented Nov 5, 2017

Ctrl+Shift+F makes a lot more sense the more I think about it, thanks for the suggestion.

@Tuhljin
Copy link
Author

Tuhljin commented Nov 5, 2017

Awesome. Looking forward to the update. I'm happy to have found this extension. The ones I tried in the past only searched tabs within the current window which did me no good. (I might have... way too many tabs open across many windows.)

@reblws
Copy link
Owner

reblws commented Nov 6, 2017

Okay the focus timeout should do it, I'll close this for now but let me know if it still doesn't work. The update should be live in a few hrs or so.

By the way, could you let me know your browser version and OS (maybe computer specs too if that's alright)? This would help me figure out why this issue occurred in the first place, as I didn't spot this on the few machines I tested on. The only reason I can think right now of why you ran into this is that you have a very fast computer.

@Tuhljin
Copy link
Author

Tuhljin commented Nov 7, 2017

I have the updated version (Ctrl+Shift+F now works, thanks for that) but the input still isn't receiving focus. I wonder if it's because I have so many tabs open.

There is an animation when the popup appears which can take a moment to complete and it's a little rough (opens smoothly at first but then suddenly snaps to a larger size). That might be normal, though. It takes less than half a second most of the time (but can take longer, generally if it's the first time or maybe if I haven't used it for a while).

I'm using Firefox 56.0.2 (64-bit) on Windows 10 with Intel i5 (4 cores, ~3.5GHz).

@reblws reblws reopened this Nov 7, 2017
@reblws
Copy link
Owner

reblws commented Nov 7, 2017

How many tabs do you have open?

@reblws
Copy link
Owner

reblws commented Nov 15, 2017

Seems like this is most likely a browser bug as mentioned in #3: https://bugzilla.mozilla.org/show_bug.cgi?id=1324255

I don't know why I'm not affected on Linux though, it looks like it should affect everyone. I'll try to get this replicated on my end so I can test the setTimeout workaround more thoroughly.

@reblws
Copy link
Owner

reblws commented Nov 16, 2017

According to this reviewer they only have the issue with the input focus when the popup badge is in the Overflow menu.

@Tuhljin, @migo77: is your TabSearch icon in the overflow menu as well?

@migo77
Copy link

migo77 commented Nov 17, 2017

For me, there's no difference! As I mentioned earlier, I noticed the same for LastPass so I believe it's a FF issue.

@ridhoq
Copy link

ridhoq commented Nov 17, 2017

+1 on this issue. I'm on Windows 10, Firefox Quantum. Ctrl-Shift-F opens the modal correctly, but the text input doesn't get focused. It doesn't matter how many tabs I have open. If the issue is upstream, is there any work around available until it gets fixed? Thanks!

@Tuhljin
Copy link
Author

Tuhljin commented Nov 19, 2017

is your TabSearch icon in the overflow menu as well?

I've tried it both ways and it doesn't make a difference.

@reblws
Copy link
Owner

reblws commented Nov 19, 2017

Can someone try this build out? tabsearch-0.3.6-possible-input-fix.zip

@ridhoq
Copy link

ridhoq commented Nov 19, 2017

@reblws Looks like no dice. I had to grab Firefox Developer edition and install your fix but looks like the same behavior as before. If you want to add some logging to that build, I can run it and screenshot the output. Also open to other suggestions.

@reblws
Copy link
Owner

reblws commented Nov 21, 2017

@ridhoq Thanks for trying. That was the only workaround I know of. The only other thing I can think of is just gradually increasing the timeout values in https://github.com/reblws/tab-search/blob/dev/fix-inputfocus/src/core/pages/popup/side-effects.js#L69 . If anyone has any suggestions let me know.

On the bright side it looks like Zilla's making progress on a patch for this popup focus bug.

I'm going to put the fix in for 0.3.7 since it doesn't really break anything, maybe it might help a few other people.

@reblws
Copy link
Owner

reblws commented Feb 23, 2018

Good news, looks like it's fixed in Firefox 60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants