-
Notifications
You must be signed in to change notification settings - Fork 15
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
Browser search finds text from all tabs instead of only active one #80
Comments
This is definitely a bug. Ideally tabber should switch to the tab where the text is highlighted. |
@alistair3149 It might be possible to handle this by placing a focus event listener on all of the content panes for the tabber, and switching to whichever one gains focus anytime the event fires. (I assume that the browser's search highlighting moves focus to the current search match, as it's cycling through them.) |
This is tricky. Browsers do not fire any event or do any DOM modifications when a match is found. It is quite difficult to exclude HTML from Find in text. I am not sure if it is even fixable... |
Hmm. That's unfortunate. I guess the old tabber must've only populated the current tab with content, and left all the other tabs empty until it performed an AJAX request when they were switched to. (And/or deleted the content when they were switched away from). That's the only other way I can think of, that it would've avoided matching text from other tabs. (EDIT: Actually it wouldn't need to use AJAX, just store the content for the other tabs outside of the DOM somewhere locally, and only insert it into the DOM when a tab becomes active.) |
The old Tabber applies a |
(!) According to Chrome, there is an event that fires on matches: (There's also an HTML attribute, MDN lists |
Ah, here's the rub, from MDN:
So, even in supporting browsers, It's also kind of strange, how it works in practice. In the example they give at the end of the article, in Firefox (which doesn't support In Chrome (which purports to support BeforeAfter |
It seems that, even in Chrome, you also have to style the |
When searching on your browser with Ctrl F, it shows results from all tabs instead of only the currently active one. As a result, it highlights hidden content from the other tabs. Since the tab doesn't change, you can't see what was found unless you manually switch the tabs. Users reported that the older Tabber extension did not do this and only showed results from the current tab.
Ideally I think it should either show only the current tab's results, or if possible, automatically switch the tab if it highlights text from a different tab.
Example of where you can see this happening (try searching for any month like January, and you'll see there's 100 results instead of only 12 for the first tab).
The text was updated successfully, but these errors were encountered: