clauderic / react-tiny-virtual-list

A tiny but mighty 3kb list virtualization library, with zero dependencies 💪 Supports variable heights/widths, sticky items, scrolling to index, and more!
https://clauderic.github.io/react-tiny-virtual-list/
MIT License
2.46k stars 166 forks source link

Added RTL support #11

Closed anzorb closed 7 years ago

anzorb commented 7 years ago

Considering there's no traction on this for other virtual lists for React (https://github.com/bvaughn/react-virtualized/issues/454) I decided this tiny lib is the perfect one to make the world's first with RTL support. :)

This change adds RTL support for languages like Arabic and Hebrew where the order of items and scrolling behaviour is reversed. This change takes into account that browsers have different implementations of RTL scrolling. Tested on Chrome, Safari, FF.

codecov[bot] commented 7 years ago

Codecov Report

Merging #11 into master will decrease coverage by 3.46%. The diff coverage is 72.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #11      +/-   ##
=========================================
- Coverage   91.66%   88.2%   -3.47%     
=========================================
  Files           3       3              
  Lines         144     178      +34     
=========================================
+ Hits          132     157      +25     
- Misses         12      21       +9
Impacted Files Coverage Δ
src/SizeAndPositionManager.js 96.1% <ø> (ø) :arrow_up:
src/constants.js 100% <100%> (ø) :arrow_up:
src/index.js 78.31% <65.62%> (-5.9%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0dc671c...1df2c3f. Read the comment docs.

anzorb commented 7 years ago

Need to add more tests to get coverage up, which is challenging because some of the scrolling code isn't covered because simulate and jsdom don't deal with scroll events properly. Will have to try something else.