Skip to content

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

Merged
merged 1 commit into from
Jan 25, 2016

Conversation

aschempp
Copy link
Contributor

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. 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:
bildschirmfoto 2015-12-11 um 10 27 55

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

@nicolas-grekas
Copy link
Member

ping @javiereguiluz

@javiereguiluz
Copy link
Member

I can't reproduce the issue (Sf 3.0, Chrome 47, Mac):

panel_right

@aschempp
Copy link
Contributor Author

@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.
Also be aware that the rule is only active if the screen size is at least 768px.

@aschempp
Copy link
Contributor Author

Here's a follow-up screencast to show the problem.

uls4fk8jke

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

What's the status of this PR? @javiereguiluz Can you have a look at this one?

@javiereguiluz
Copy link
Member

I can confirm that this PR fixes the issue:

Before After
before after

Thanks @aschempp.

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

Thank you @aschempp.

@fabpot fabpot merged commit 79474a6 into symfony:2.8 Jan 25, 2016
fabpot added a commit that referenced this pull request Jan 25, 2016
…(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:
![bildschirmfoto 2015-12-11 um 10 27 55](https://cloud.githubusercontent.com/assets/1073273/11740305/e2c94cfc-9ff1-11e5-86ae-1fd94ec5a93e.png)

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
@fabpot fabpot mentioned this pull request Feb 3, 2016
@fabpot fabpot mentioned this pull request Feb 28, 2016
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
…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:
![bildschirmfoto 2015-12-11 um 10 27 55](https://cloud.githubusercontent.com/assets/1073273/11740305/e2c94cfc-9ff1-11e5-86ae-1fd94ec5a93e.png)

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
@aschempp aschempp deleted the patch-1 branch November 23, 2019 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants