Skip to content
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

[Bug]: ons-grid__col--sticky CSS functionality is broken #2835

Closed
8 of 14 tasks
AlanHONS opened this issue Oct 17, 2023 · 0 comments · Fixed by #2960
Closed
8 of 14 tasks

[Bug]: ons-grid__col--sticky CSS functionality is broken #2835

AlanHONS opened this issue Oct 17, 2023 · 0 comments · Fixed by #2960
Assignees
Labels
Bug Something isn't working

Comments

@AlanHONS
Copy link

What happened?

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

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;
image

What version of the ONS Design System are you using?

65.2.5

What devices are you seeing the problem on?

  • Desktop
  • Mobile
  • Tablet

Device details

ONS PC and ONS Macbook

What operating systems are you seeing the problem on?

  • Windows
  • macOS
  • Android
  • iOS
  • Other

Operating system details

Windows 10 and macOS Sonoma 14.0

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge
  • Microsoft Internet Explorer
  • Other

Browser details

All modern browsers as of Oct 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants