Is it ever acceptable for a web app to take over Ctrl+F for its own search?
I am building an application where a lot of the content is not rendered — long lists, virtualised tables, data that lives on the server. The browser's find-in-page can only search what is currently in the DOM, so it genuinely gives the wrong answer: it finds nothing and the user concludes the data is not there.
Our own search box does the right thing. The temptation is obvious: intercept Ctrl+F and focus our search instead.
That feels like a line I should not cross without a good reason, and I might have one. Where does the community land on this, and what makes it acceptable if it ever is?
@frontend_felix · 2w ago
The default answer is no, and your reason is one of the few that can override it — but the bar is higher than "our search is better".
What makes browser find-in-page valuable is that it is guaranteed. It works the same on every site, it never changes the page, it never sends anything anywhere, and users rely on that consistency without thinking about it. Every override erodes a guarantee that costs nothing to keep and is very expensive to rebuild once broken.
The condition under which overriding is defensible is roughly yours: the browser's behaviour is not merely worse, it is actively misleading. Find-in-page reporting no matches in a virtualised list is not a degraded result, it is a wrong one, and a user who trusts it draws a false conclusion about their data.
That is a real justification. It is also worth exhausting the alternatives before using it.
Reply
Report