feature #32429 [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F (ogizanagi)
This PR was merged into the 4.4 branch.
Discussion
----------
[VarDumper] Let browsers trigger their own search on double CMD/CTRL + F
| Q | A
| ------------- | ---
| Branch? | 4.4 <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #29748 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Simple way to enhance DX & mitigate #29748
Commits
-------
d2430584cd
[VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit
This commit is contained in:
commit
29654a4c02
@ -588,6 +588,15 @@ return function (root, x) {
|
||||
var isSearchActive = !/\bsf-dump-search-hidden\b/.test(search.className);
|
||||
if ((114 === e.keyCode && !isSearchActive) || (isCtrlKey(e) && 70 === e.keyCode)) {
|
||||
/* F3 or CMD/CTRL + F */
|
||||
if (70 === e.keyCode && document.activeElement === searchInput) {
|
||||
/*
|
||||
* If CMD/CTRL + F is hit while having focus on search input,
|
||||
* the user probably meant to trigger browser search instead.
|
||||
* Let the browser execute its behavior:
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
search.className = search.className.replace(/\bsf-dump-search-hidden\b/, '');
|
||||
searchInput.focus();
|
||||
|
Reference in New Issue
Block a user