jquery / jquery/api.jquery.com
scrollLeft() does not always return an Integer
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 325
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
Documentation issue: scrollLeft can return a Double in Chrome (tested in Chrome 96) and Edge.
Repro by changing the zoom level and scrolling horizontally.
https://jsfiddle.net/d6u2sjth/4/
MDN says: "Warning: On systems using display scaling, scrollLeft may give you a decimal value"
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
See also: https://github.com/jquery/api.jquery.com/issues/608
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the jQuery API documentation entry for scrollLeft and compare its return-value description with the linked MDN guidance and Chrome/Edge behavior. Update the documentation to note that horizontal scrolling can produce decimal values under display scaling or zoom; the issue is done when this behavior is accurately documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100