You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to use ons-grid__col--sticky CSS class did not result in the expected behaviour
What was the expected outcome?
Properly wrapped ons-grid__col--sticky content was expected to switch from original/relative to floating/fixed position onscreen, depending on whether that element's original position was onscreen or not.
How is this problem impacting your service?
Design of planned IDS Website page wants to make use of a floating 'Back to top' link using pure CSS functionality already in the design system. Without this functionality user's will how no quick way to return to alternate page and jump link choices.
What list of steps can be followed to reproduce the bug or issue?
After discovering issue initially within out IDS Website prototype I created a new simplified example page under latest 65.2.5 of the design system at simplified code example page
Right column content on that page should be sticky and stay onscreen when the page is scrolled. However doesn't currently.
Joe Nation found that root cause is that base page parent DIV of .ons-page has a CSS style of overflow-x: hidden;.
Which prevents child right column CSS position: sticky; from working when applied via ons-grid__col--sticky@m
Joe Nation recommended fix is to override overflow-x: hidden; to overflow-x: inherit; or similar on .ons-page. Which does restore ons-grid__col--sticky CSS class functionality.
But needs investigation of why overflow-x: hidden; is being applied to .ons-page
What happened?
Attempting to use
ons-grid__col--sticky
CSS class did not result in the expected behaviourWhat was the expected outcome?
Properly wrapped
ons-grid__col--sticky
content was expected to switch from original/relative to floating/fixed position onscreen, depending on whether that element's original position was onscreen or not.How is this problem impacting your service?
Design of planned IDS Website page wants to make use of a floating 'Back to top' link using pure CSS functionality already in the design system. Without this functionality user's will how no quick way to return to alternate page and jump link choices.
What list of steps can be followed to reproduce the bug or issue?
After discovering issue initially within out IDS Website prototype I created a new simplified example page under latest 65.2.5 of the design system at simplified code example page
Right column content on that page should be sticky and stay onscreen when the page is scrolled. However doesn't currently.
Joe Nation found that root cause is that base page parent DIV of
.ons-page
has a CSS style ofoverflow-x: hidden;
.Which prevents child right column CSS
position: sticky;
from working when applied viaons-grid__col--sticky@m
Joe Nation recommended fix is to override
overflow-x: hidden;
tooverflow-x: inherit;
or similar on.ons-page
. Which does restoreons-grid__col--sticky
CSS class functionality.But needs investigation of why
overflow-x: hidden;
is being applied to.ons-page
Example
https://github.com/ONSdigital/ixd-ons-prototype-playpen/blob/main/src/prototypes/sticky/index.njk
Screenshot of page + applied fix when overriding
.ons-page
>overflow-x: hidden;
What version of the ONS Design System are you using?
65.2.5
What devices are you seeing the problem on?
Device details
ONS PC and ONS Macbook
What operating systems are you seeing the problem on?
Operating system details
Windows 10 and macOS Sonoma 14.0
What browsers are you seeing the problem on?
Browser details
All modern browsers as of Oct 2023
The text was updated successfully, but these errors were encountered: