Automattic / Automattic/antiscroll

Add a Minimum scroller height/width

Open
#33 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
156
PR merge metrics
No merged PRs in 30d

Description

See this [screenshot](http://i.imgur.com/bbhJZ.png). That tiny little black thing at the right side is antiscroll.

A simple fix is to add a minimal height, and adjust the top position based on it:

``` javascript
// Scrollbar.Vertical.prototype.update

height = trackHeight * paneHeight / innerEl.scrollHeight
top = trackHeight * innerEl.scrollTop / innerEl.scrollHeight

if height < 30
top = top - (30 - height)
height = 30

this.el
.css('height', height)
.css('top', top)
```

Minimum height should probably be an option, as well.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at Scrollbar.Vertical.prototype.update, which the issue identifies, and locate the corresponding horizontal scrollbar update for the width behavior. Confirm how scrollbar dimensions are calculated, then verify that minimum height and width are configurable options and that both scrollbars keep the intended positioning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.