-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[FIX] portal: odd sidebar on IE11 #32484
[FIX] portal: odd sidebar on IE11 #32484
Conversation
576f52f
to
e153eb5
Compare
@@ -182,6 +182,12 @@ hr { | |||
background-color: inherit; | |||
} | |||
|
|||
// IE 11 hack | |||
// http://browserhacks.com/#hack-d19e53a0fdfba5ec0f283ae86175a3af | |||
*::-ms-backdrop, :root, .flex-lg-grow-0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Julien00859 , I think that this selector it's too much generic.
It will affects all the .flex-lg-grow-0
elements, even outside portal (the file is included in the frontend bundle). I suggest to restrict to the sidebar only.
e153eb5
to
88f0717
Compare
@@ -182,6 +182,12 @@ hr { | |||
background-color: inherit; | |||
} | |||
|
|||
// IE 11 hack | |||
// http://browserhacks.com/#hack-d19e53a0fdfba5ec0f283ae86175a3af | |||
*::-ms-backdrop, :root, .o_portal_sale_sidebar .flex-lg-grow-0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better, but since the fix it's really specific (252px), I'd prefer to affect the element only (adding a class maybe?).
Did you already checked if it's ok on Edge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work fine on Edge.
Is a new class really neede ? The only elements in odoo using the .o_portal_sale_sidebar
class are the sidebars affected by the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using a real solution like fixing the template ? col-lg flex-lg-grow-0
makes no sense, it says "hey take the space required to fill the remaining space starting from 0 width but hey... you cannot grow !" ... using col-lg-auto
seems to be what was wanted here and would probably work on IE11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only elements in odoo using the .o_portal_sale_sidebar class are the sidebars affected by the bug.
I'm not a big fan of specific rules targeting framework classes 😕 (more down).
Website team ? @seb-odoo , @kea14
(@qsm-odoo is in holiday)
If we add (or xpath) a new element with .flex-lg-grow-0
class, it will be affected too. It's not an issue at the moment, but it will complicate things in the future.
Eg. "Client complain some elements are too big"
[...].o_portal_sale_sidebar .flex-lg-grow-0:not(btn):not(div:first-child()):not(.bg-beta)
😢
Moreover, it's probably the sidebar that should have the o_portal_sale_sidebar
class (rather than the main container).
I suggest to review how classes are assigned here (solving the double classes assignment you showed me too) and then apply the fix on the right element only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I am not on holiday, I am actually dying in India.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I am not on holiday, I am actually dying in India.
I can feel the same heat. 😓
@@ -182,6 +182,12 @@ hr { | |||
background-color: inherit; | |||
} | |||
|
|||
// IE 11 hack | |||
// http://browserhacks.com/#hack-d19e53a0fdfba5ec0f283ae86175a3af | |||
*::-ms-backdrop, :root, .o_portal_sale_sidebar .flex-lg-grow-0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using a real solution like fixing the template ? col-lg flex-lg-grow-0
makes no sense, it says "hey take the space required to fill the remaining space starting from 0 width but hey... you cannot grow !" ... using col-lg-auto
seems to be what was wanted here and would probably work on IE11.
Fixing the template definitely seems the nice choice here. I wasn't aware of that bootstrap class, let me try... |
@stefanorigano the double classes are due to the odoo/addons/portal/views/portal_templates.xml Line 177 in 8f4b98e
the variable expands to col-12 col-lg flex-lg-grow-0 d-print-none
|
88f0717
to
abdf175
Compare
Last commit ( Edit: related PR on enterprise: https://github.com/odoo/enterprise/pull/4057 |
and as always, @qsm-odoo saved the day 👍 |
I see |
|
@qsm-odoo if it is ok for you, can you r+ ? |
@robodoo r+ |
@robodoo r- : commit message is mentioning "portal" while multiple apps are touched and I see "bellow" |
What would a correct commit message looks like ? "and I see 'bellow'" ???? |
As you wish as long as you mention the apps you touch... I personally would write And yes, you wrote "bellow" in your commit message... |
abdf175
to
6640004
Compare
ping @qsm-odoo |
ping @qsm-odoo I have customers waiting |
Title: [FIX] account, portal, sale: odd sidebar on IE11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robodoo r+
Linked pull request(s) odoo/enterprise#4057 not ready. Linked PRs are not staged until all of them are ready. |
Open a quotation from the portal using IE11. The sidebar is rendered as it did not have any width. What we are trying to achieve on large screens is to create a sidebar with a fix width the size of its children and to let the rest of the content (right to the sidebar) expands. On small screens we want to invert the direction from left-to-right to up-to-bottom. The classes `col-12`, `col-lg` and `flex-lg-grow-0` are used to fulfill that purpose. The problem is due to the rule `flex-grow: 0 !important` applied by the selector `.flex-lg-grow-0` on the sidebar. On Chrome/Firefox the dom element takes the width of his children as minimal width, the `flex-grow: 0` does not shrink the element below that minimal width. IE11 does not set a minimal width based on the child elements of the node, the width is equal to 0 and the `flex-grow: 0` forbid it from growing. The solution is to replace the said classes by the `col-lg-auto` class that does exactly what we want and is cross-browser. opw-1944188 opw-1935087
6640004
to
d37948b
Compare
robodoo r+ |
Merged, thanks! |
Open a quotation from the portal using IE11. The sidebar is rendered as
it did not have any width.
What we are trying to achieve on large screens is to create a sidebar
with a fix width the size of its children and to let the rest of the
content (right to the sidebar) expands. On small screens we want to
invert the direction from left-to-right to up-to-bottom.
The classes
col-12
,col-lg
andflex-lg-grow-0
are used to fulfillthat purpose.
The problem is due to the rule
flex-grow: 0 !important
applied by theselector
.flex-lg-grow-0
on the sidebar. On Chrome/Firefox the domelement takes the width of his children as minimal width, the
flex-grow: 0
does not shrink the element bellow that minimal width.IE11 does not set a minimal width based on the child elements of the
node, the width is equal to 0 and the
flex-grow: 0
forbid it fromgrowing.
The solution is to replace the said classes by the
col-lg-auto
classthat does exactly what we want and is cross-browser.
opw-1944188
opw-1935087