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

Inserter scroll indicator #996

Merged
merged 2 commits into from
Jun 2, 2017
Merged

Conversation

jasmussen
Copy link
Contributor

This PR adds a bottom box shadow to the scroll inserter, indicating you can scroll. This fixes #776.

Originally I also intended to look deeper into whether we could fix scroll bleed. I got far enough that if we add this CSS, we can prevent scrolling of the body content:

.toplevel_page_gutenberg {
	&.is-scroll-locked {
		overflow: hidden;

		.gutenberg {
			overflow: scroll;
		}
	}
}

That worked pretty well — all you had to do with that is add the CSS class is-scroll-locked when mousing over something like the inserter, then remove it again when mousing off. Then scroll bleed solved.

Problem is, it relies on creating a fake scrollbar to indent the page, so there isn't a jarring page "jog" when the scrollbar is locked away. This doesn't work with fixed position elements, beckoning hacks that I don't think we'll want to go into.

As such, it seems if we want to address scroll bleed, we should probably look into https://codepen.io/joen/pen/dMEyjr or https://codepen.io/joen/pen/wGLjWG.

In the mean time, no reason not to merge this in, right?

Also style scrollbars in preparation for a scrolllock experiment.
@jasmussen jasmussen requested a review from ellatrix June 2, 2017 12:01
@ellatrix
Copy link
Member

ellatrix commented Jun 2, 2017

For me there is nothing to scroll now. Also in master. The whole area is expanded.

@jasmussen
Copy link
Contributor Author

For me there is nothing to scroll now. Also in master. The whole area is expanded.

Yeah sorry, it's a bit hard to test. Try making the viewport really short.

Copy link
Member

@ellatrix ellatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha. :) This looks good, though I'd love it if the shadow would go away once you reach the end, and a shadow would appear at the top once you start scrolling. Maybe there's a react wrapper component for this somewhere.

@jasmussen jasmussen merged commit 43f9058 into master Jun 2, 2017
@jasmussen
Copy link
Contributor Author

jasmussen commented Jun 2, 2017

Aha. :) This looks good, though I'd love it if the shadow would go away once you reach the end, and a shadow would appear at the top once you start scrolling. Maybe there's a react wrapper component for this somewhere.

That would be a nice future improvement!

Also thanks!

@aduth
Copy link
Member

aduth commented Jun 2, 2017

This looks good, though I'd love it if the shadow would go away once you reach the end

Only end bit, but related all the same: https://github.com/Automattic/wp-calypso/blob/8e36bb2/client/components/tinymce/plugins/touch-scroll-toolbar/plugin.js#L23-L51

@youknowriad youknowriad deleted the update/inserter-scroll-indicator branch June 2, 2017 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No indication that the inserter is scrollable
3 participants