maxmmyron / twentyfortygreat

MIT License
0 stars 1 forks source link

Improve `scrollInt` performance #10

Open maxmmyron opened 1 year ago

maxmmyron commented 1 year ago

scrollInt is a nice QoL feature, but it seems a little flaky.

Might be possible to remove scrollInt by encapsulating dropdown content in a container that takes the height of the content (using scrollHeight). That way, the page height is updated instantly and we can just use one scrollIntoView call.

tadhgj commented 1 year ago

I did not feel like making a wrapper for the div so I just spammed scrollIntoView Good idea

tadhgj commented 1 year ago

in #12, I changed the setInterval to go on for 800ms, the same length of the css transition, so it now scrolls fully to the bottom.

it's still janky when you expand and then immediately scroll up

maxmmyron commented 1 year ago

so I just spammed scrollIntoView

lmfao Maybe we shouldn't hijack the user's scroll, since it's not always a good idea and a bitch to implement I can take a look at this in a little bit