~cytrogen/masto-fe

685270f3f7ea6d4a8a48ec641e8fdfd9fc2e2d7f — Claire 2 years ago 66e82cb
[Glitch] Fix clicking “Explore” or “Live feeds” column headers to scroll in advanced mode

Port e90649b0641910225e04e308e59297f8c91b96a8 to glitch-soc

Co-authored-by: Plastikmensch <Plastikmensch@users.noreply.github.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
1 files changed, 13 insertions(+), 1 deletions(-)

M app/javascript/flavours/glitch/components/column.jsx
M app/javascript/flavours/glitch/components/column.jsx => app/javascript/flavours/glitch/components/column.jsx +13 -1
@@ 18,7 18,19 @@ export default class Column extends PureComponent {
  };

  scrollTop () {
    const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable');
    let scrollable = null;

    if (this.props.bindToDocument) {
      scrollable = document.scrollingElement;
    } else {
      scrollable = this.node.querySelector('.scrollable');

      // Some columns have nested `.scrollable` containers, with the outer one
      // being a wrapper while the actual scrollable content is deeper.
      if (scrollable.classList.contains('scrollable--flex')) {
        scrollable = scrollable?.querySelector('.scrollable') || scrollable;
      }
   }

    if (!scrollable) {
      return;