Open fmfernandes opened 10 months ago
@fmfernandes -- excellent report!
do you have a theory re what's happening?
I haven't taken a look at the code but I guess it's some race condition.
I also noticed that the scroll bar increases in size as, and that's because the actual content of the tabs get appended to the content, it's just not showing as the first thing, so, maybe something like this:
I'm not sure how tied is displayRiver
to tabClickCallback
but that may be the issue. Another possibility is also that appending items to the DOM is taking too long that I'm able to switch tabs before it's appended.
Those are all just rough guesses 🙂
While doing some tests for https://github.com/scripting/Scripting-News/issues/287 I came across a strange behavior which I can constantly replicate: if you switch tabs while another one is loading, the contents of the loading tab will be the same as the the first one. I recorded a couple videos demonstrating that.
Expected behavior
Tabs load as I go through them
https://github.com/scripting/a8c-FeedLand-Support/assets/24195829/e176f0f5-641a-47eb-9919-9c56931c8249
What happens
If I switch tabs fast enough, the content will be replaced and not appended to the document. In the end you can see all tabs have the same content except for the Dave tab (which I wasn't fast enough to switch before loading).
https://github.com/scripting/a8c-FeedLand-Support/assets/24195829/1db97044-9f3a-4ce8-b5c7-c07bcb179f67