Skip to content

Commit d243058

Browse files
committed
[VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit
1 parent 350ec6c commit d243058

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,15 @@ function showCurrent(state)
588588
var isSearchActive = !/\bsf-dump-search-hidden\b/.test(search.className);
589589
if ((114 === e.keyCode && !isSearchActive) || (isCtrlKey(e) && 70 === e.keyCode)) {
590590
/* F3 or CMD/CTRL + F */
591+
if (70 === e.keyCode && document.activeElement === searchInput) {
592+
/*
593+
* If CMD/CTRL + F is hit while having focus on search input,
594+
* the user probably meant to trigger browser search instead.
595+
* Let the browser execute its behavior:
596+
*/
597+
return;
598+
}
599+
591600
e.preventDefault();
592601
search.className = search.className.replace(/\bsf-dump-search-hidden\b/, '');
593602
searchInput.focus();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy