[directorytree] Clamp directory tree horizontal scroll to 0
The directory tree does not support horizontal scrolling (by design), but expanding sub-directories using the keyboard can reveal directory entries that are wider than the directory tree element and cause the tree element to gain a scrollLeft > 0 (the tree is scrolled left, in the horizontal). One fix is CSS overflow-x: clip, but chromium does not support it yet. Another way is to observe 'scroll' events and clamp the tree's scrollLeft to 0 if needed. And because browser 'scroll' event are very frequent, and we only need keep-up with the keyboard input rate, perform the clamp in a RAF to throttle the 'scroll' event processing rate. Bug: 1025581 Change-Id: I7c4b0a06fee9cf6356d914314b561feb0da8f7a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1924341Reviewed-by:Luciano Pacheco <lucmult@chromium.org> Reviewed-by:
Noel Gordon <noel@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#716962}
Showing
Please register or sign in to comment