karrot-dev / karrot-frontend

We migrated to https://codeberg.org/karrot/karrot-frontend
https://codeberg.org/karrot/karrot-frontend
428 stars 177 forks source link

scrolling back to the top while typing #2609

Closed brnsolikyl closed 1 year ago

brnsolikyl commented 1 year ago

While typing a longer message, it keeps bringing you back to the top so you don't get to see what you're typing while you do it.

We noticed this while typing longer messages on two places:

Probably more places where it's happening...

This is quite annoying so I'd say prioritize this

dwaxweiler commented 1 year ago

I have also noticed this issue when typing in the description field of a place with a lot of text (higher than window).

tiltec commented 1 year ago

I made a change that should fix this, hopefully to be deployed tomorrow.

tiltec commented 1 year ago

Problem still there

nicksellen commented 1 year ago

I had a look into this, but could not find the cause.

It doesn't seem like it's related to our scrolling code (which is about scrolling when we load new messages).

I also wondered if it's happening when the input is being focused, but add an @focus on the input involved showed that it wasn't being triggered.

I also tried out the autogrow input on the quasar page, but that doesn't have the issue.

I have run out of time for now, but the two avenues I would explore next are:

nicksellen commented 1 year ago

.... ok, I looked a bit more, but still didn't find the cause, I did get familiar with the event listener breakpoint feature in chrome though (dev tools -> sources -> event listener breakpoints), trying keydown and scroll events to see if I can see something about where they come from, I temporarily disabled various things that do relate to those events, but it still had the bug, so they were unrelated.

Another idea to throw in, which I quite like, is to use css position: sticky, bottom: 0. It actually behaves quite nicely, if there are not many messages it's under them, but once it reaches the bottom of the screen, it then grows upwards from there...

however.... whatever is causing it to scroll up still does it to the messages... (just the position sticky keeps the text input usable....). so it would be an improvement over what we have now... but still really need to find out what is causing the jump.

I think process of elimination is the next step here... I won't be able to look at this for at least another week now, so if anybody feels willing and capable to look into it, please do!