Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Can't click through the gradient on the "Overflow scroll gradient" #26

Closed
cuth opened this issue Feb 27, 2018 · 2 comments
Closed

Can't click through the gradient on the "Overflow scroll gradient" #26

cuth opened this issue Feb 27, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@cuth
Copy link

cuth commented Feb 27, 2018

Overflow scroll gradient

This snippet adds a transparent-to-white gradient on top of a scrollable area giving the effect that the content is fading away. For the majority of the area underneath this content, a user would think it would still be able to interact with the content but the gradient would block any interaction.

TLDR

Buttons at the bottom of the scroll area are un-clickable. Text at the bottom of the scroll area is un-selectable.

The fix is to add pointer-events: none to the gradient:

.overflow-scroll-gradient {
  position: relative;
}
.overflow-scroll-gradient::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 300px;
  height: 25px;
  background: linear-gradient(rgba(255, 255, 255, 0.001), white); /* transparent keyword is broken in Safari */
  pointer-events: none;
}
.overflow-scroll-gradient__scroller {
  overflow-y: scroll;
  background: white;
  width: 300px;
  height: 250px;
  padding: 15px 0;
  line-height: 1.2;
  text-align: center;
}

Browser Support

https://caniuse.com/#search=pointer-events

@atomiks
Copy link
Contributor

atomiks commented Feb 27, 2018

Waiting to be implemented here: #23
I can add it manually if he doesn't respond though

@atomiks atomiks closed this as completed Feb 27, 2018
@atomiks atomiks added the bug Something isn't working label Feb 28, 2018
@lock
Copy link

lock bot commented Dec 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants