Scroll item horizontally in the virtuallist, taking into account the fixed size#4401
Conversation
Codecov ReportBase: 88.55% // Head: 88.55% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4401 +/- ##
=======================================
Coverage 88.55% 88.55%
=======================================
Files 283 282 -1
Lines 25532 25478 -54
Branches 6878 6855 -23
=======================================
- Hits 22610 22563 -47
+ Misses 2715 2708 -7
Partials 207 207
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
canova
left a comment
There was a problem hiding this comment.
Thanks, this indeed looks like a lot better when I'm using it.
| const itemLeft = offsetX; | ||
| const itemRight = itemLeft + interestingWidth; | ||
| const itemLeft = itemX; | ||
| const itemRight = itemX + interestingWidth; |
There was a problem hiding this comment.
I'm curious why we don't add the offsetX to itemRight here. It looks like we do the same operation twice below (first we remove the offsetX from the other side of the comparison and then add it later).
There was a problem hiding this comment.
I think itemRight itself should stay like this, as this represents properly the right edge for the item, but I can introduce another variable that would be itemRight - (container.clientWidth - offsetX), just not sure what its ideal name is. container.clientWidth - offsetX itself could be called scrollingColumnWidth, so maybe itemRight - scrollingColumnWidth is minimumLeftScrollingToSeeRightEdge? I'm not sure :D I'll think about this some more.
There was a problem hiding this comment.
I could add some ascii art for the container.
There was a problem hiding this comment.
Well, I think it's not a big deal. So happy to land it like this too.
There was a problem hiding this comment.
I decided to only add scrollingColumnWidth because I thought the reasoning process was easier to follow with keeping the calculations, but I also added some more comments. Hopefully this should make it easier to reason when looking at this in the future :-)
9a78046 to
f1ae1fb
Compare
This was bothering me for so much time!
Here is the fix to the following STR:
This also fixes the STR where clicking in the activity graph should now properly horizontally scroll to the item.
When testing, depending on the size of your screen, you may need to reduce the size of your window, or run the profiler in Firefox mobile view to reduce its viewport, so that horizontally scrolling is necessary for some depths.
You can also increase the size of some columns (not available in production).
production
deploy preview