8000 feature #28854 [VarDumper] Scroll into view when searching (ro0NL) · symfony/symfony@9bb60c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9bb60c9

Browse files
committed
feature #28854 [VarDumper] Scroll into view when searching (ro0NL)
This PR was merged into the 4.2-dev branch. Discussion ---------- [VarDumper] Scroll into view when searching | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This jumps to the found element when using the javascript widget for searching HTML dumps. Inspired by Ctrl+F in Chrome :) It's super convenient with long dumps, however i wasnt able to position the search input on the right in a fixed manner... because CSS 😓 i was hoping @ogizanagi could add a patch for it. Also see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView Commits ------- 647a937 [VarDumper] Scroll into view when searching
2 parents c11fe35 + 647a937 commit 9bb60c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ function showCurrent(state)
504504
if (currentNode) {
505505
reveal(currentNode);
506506
highlight(root, currentNode, state.nodes);
507+
if ('scrollIntoView' in currentNode) {
508+
currentNode.scrollIntoView();
509+
}
507510
}
508511
counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count();
509512
}

0 commit comments

Comments
 (0)
0