Bug 398605 - Closing the 'find' toolbar should clear search field
Summary: Closing the 'find' toolbar should clear search field
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.5.1
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-14 05:27 UTC by Kishore Gopalakrishnan
Modified: 2022-01-28 04:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2018-09-14 05:27:58 UTC
Steps to reproduce:
1. Open a PDF file.
2. Search for a word it contains (using the toolbar that appears when you press 'CTRL+F').
3. The result is highlighted in the PDF.
4. Now close the search toolbar.

Observed result:
Note that the search result is still highlighted. Removing this highlight requires one to manually clear the search toolbar before closing it. On pressing 'CTRL+F' again, one sees that the earlier search result is still in the search field. Clearing this clears the highlight.

Expected result:
The search field text should be cleared on closing the toolbar, so that the search highlight is not shown when the toolbar is not visible.
Comment 1 Laura David Hurka 2018-09-16 15:20:32 UTC
I like this behaviour. This way I can hide the search bar after typing to save screen space. ("Find all" would be useful.) Additionally, I can easily edit the search query later.

Why would it be useful to remove the highlight when closing the search bar?

Also interesting: Hover the X sign with the mouse and clear the search field with backspace. Result: The mouse curser becomes invisible
Comment 2 Kishore Gopalakrishnan 2018-09-17 05:03:33 UTC
Personally, I feel that it is more in line with the user's expectations to not highlight search terms once the search bar is closed (this is the case in browser 'find' toolbars, for instance). Perhaps there should be a 'minimize' button if the user wants to hide the bar without clearing the field.

I'm not sure if I'm missing something, but there is currently no simple way to dismiss both the bar and the search term highlights once I find what I'm searching for. I frequently find myself searching for something, finding what I want, closing the toolbar, and then having to open it again after noticing that the search terms are still highlighted. Even if I were to somehow break this habit, I would still have to manually clear the search field before closing the search bar each time.

One way to accomodate both our usecases would be to keep the search term as it is in the search field even after it is closed, but somehow make sure that the terms in the document aren't highlighted when the bar is closed. However, I'm not sure if this would be easy or difficult to implement.
Comment 3 Albert Astals Cid 2018-09-20 17:44:09 UTC
(In reply to Kishore Gopalakrishnan from comment #2)
> I'm not sure if I'm missing something, but there is currently no simple way
> to dismiss both the bar and the search term highlights once I find what I'm
> searching for. 

Press Esc twice.

This is a wishlist and honestly i'm very close to marking it WONTFIX. This is the behaviour Okular has had for more than a decade, unless you can find hordes of people agreeing with you, it means people like the current behaviour.
Comment 4 Kishore Gopalakrishnan 2018-09-21 04:13:30 UTC
(In reply to Albert Astals Cid from comment #3)
> (In reply to Kishore Gopalakrishnan from comment #2)
> > I'm not sure if I'm missing something, but there is currently no simple way
> > to dismiss both the bar and the search term highlights once I find what I'm
> > searching for. 
> 
> Press Esc twice.
> 
> This is a wishlist and honestly i'm very close to marking it WONTFIX. This
> is the behaviour Okular has had for more than a decade, unless you can find
> hordes of people agreeing with you, it means people like the current
> behaviour.

Oh okay. That makes sense.
Comment 5 Wing Hong Chan 2022-01-28 04:36:37 UTC
On the web browsers I’ve used (Chrome, Firefox, Epiphany), closing the find bar with text still in it will leave the last-found text highlighted, but with the normal blue text-selection style of highlight. Clicking anywhere will un-highlight the text, just like normal text selection. This would be more familiar and discoverable than pressing Esc twice, which I found only now on this bug page after using Okular for ten months.