Swap out the resizer lib for something more stable

react-resizer appears to be okay at tracking state, but it often desyncs from reality. re-resizer is more maintained and more broadly used (160k downloads vs 110k), and appears to generally do a better job of tracking the cursor.

The new library has some oddities though, such as deltas, touch support (hence the polyfill), and calling handles "Enable".

For https://github.com/vector-im/riot-web/issues/14022
This commit is contained in:
Travis Ralston 2020-07-07 19:36:26 -06:00
parent 7f757cd0f3
commit 15b6a273c9
6 changed files with 114 additions and 47 deletions

View file

@ -89,11 +89,12 @@ export class ListLayout {
return 5 + RESIZER_BOX_FACTOR;
}
public setVisibleTilesWithin(diff: number, maxPossible: number) {
public setVisibleTilesWithin(newVal: number, maxPossible: number) {
maxPossible = maxPossible + RESIZER_BOX_FACTOR;
if (this.visibleTiles > maxPossible) {
this.visibleTiles = maxPossible + diff;
this.visibleTiles = maxPossible;
} else {
this.visibleTiles += diff;
this.visibleTiles = newVal;
}
}