symfony: [VarDumper] Expand // Collapse is broken

Symfony version(s) affected

6.2.1

Description

With a very fresh Symfony 6.2 the HTML dump does not work well. When I click on it does not expand / collapse anymore, and the dump is always expanded.

How to reproduce

symfony new --webapp  symfony-62
cd symfony-62
bin/console make:controller Homepage
symfony serve -d
code src/Controller/HomepageController.php

⬇️

#[Route('/', name: 'app_homepage')]
    public function index(): Response
    {
        dd([
            'a' => [
                'b' => [
                    'c' => [
                        '' => range(1, 10),
                    ]
                ]
            ]
        ]);

image

Possible Solution

No response

Additional Context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

OK, I found the culprit: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi

With this extension, it does not work. Without it works

edit: I also checked, and VarDumper 5.4.* is also affected.


I don’t know if we need to fix that on our side, But I’m going to open a ticket there

If https://github.com/facebook/react/issues/25897#issuecomment-1379553104 is right then the problem is from Symfony.

Could someone try it?

I have this issue too. My setup is: macos arm ventura 13.0.1 - google chrome 108.0.5359.98

This happens because somehow js that adds css to dumper page not triggers. Safari is fine btw. I think this is chrome bug, but it’s annoying.

For local env I added

pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }

before this line https://github.com/symfony/var-dumper/blob/6.2/Dumper/HtmlDumper.php#L641

and this code is not invoking or working properly: https://github.com/symfony/var-dumper/blob/6.2/Dumper/HtmlDumper.php#L160

why - idk