-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Overriding profiler position in CSS breaks JS positioning #16961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ping @javiereguiluz |
@javiereguiluz Looks like your panel popup is opening to the left. That's because the Doctrine panel seems not to be wide enough to have room for the width of the popup. Please try to add another panel that floats to the right so that the config panel should open to the right. |
What's the status of this PR? @javiereguiluz Can you have a look at this one? |
I can confirm that this PR fixes the issue:
Thanks @aschempp. |
Thank you @aschempp. |
…(aschempp) This PR was merged into the 2.8 branch. Discussion ---------- Overriding profiler position in CSS breaks JS positioning | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The positioning of a profiler info block (open to the left or right) is [calculated using Javascript](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig#L35). Since Symfony 2.8, the config/version panel is right-aligned and opens to the left. If another panel is added to the right of it, the panel cannot open correctly. Styles are unset in https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig#L46-L47 but that means it is set back to the stylesheet settings, which results in `right:0, left:0` on the element. Manual testing is fairly easy: Just add a CSS class `sf-toolbar-block-right` on one or multiple panels (e.g. Doctrine) that result in the Config panel to have enough room to open to the right. Here's a screenshot of the problem:  The other option would be to set the position in javascript to `right: auto` instead of unsetting, but I prefer to fix invalid CSS ;-) Commits ------- 79474a6 Profiler CSS position conflicts with JS detection
…ioning (aschempp) This PR was merged into the 2.8 branch. Discussion ---------- Overriding profiler position in CSS breaks JS positioning | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The positioning of a profiler info block (open to the left or right) is [calculated using Javascript](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig#L35). Since Symfony 2.8, the config/version panel is right-aligned and opens to the left. If another panel is added to the right of it, the panel cannot open correctly. Styles are unset in https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig#L46-L47 but that means it is set back to the stylesheet settings, which results in `right:0, left:0` on the element. Manual testing is fairly easy: Just add a CSS class `sf-toolbar-block-right` on one or multiple panels (e.g. Doctrine) that result in the Config panel to have enough room to open to the right. Here's a screenshot of the problem:  The other option would be to set the position in javascript to `right: auto` instead of unsetting, but I prefer to fix invalid CSS ;-) Commits ------- 79474a6 Profiler CSS position conflicts with JS detection
The positioning of a profiler info block (open to the left or right) is calculated using Javascript. Since Symfony 2.8, the config/version panel is right-aligned and opens to the left. If another panel is added to the right of it, the panel cannot open correctly.
Styles are unset in https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig#L46-L47 but that means it is set back to the stylesheet settings, which results in
right:0, left:0
on the element.Manual testing is fairly easy: Just add a CSS class
sf-toolbar-block-right
on one or multiple panels (e.g. Doctrine) that result in the Config panel to have enough room to open to the right.Here's a screenshot of the problem:

The other option would be to set the position in javascript to
right: auto
instead of unsetting, but I prefer to fix invalid CSS ;-)