farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
62 stars 39 forks source link

General and Movement tabs scroll position is synced in Firefox #321

Closed mstenta closed 4 years ago

mstenta commented 4 years ago

In Firefox, the General and Movement tabs seem to share the same scroll positioning and overall DIV height. This is an issue of confusion if you scroll all the way to the bottom of the General tab and then switch to the Movement tab - all you see is a blank white screen. But if you scroll back up, then you see the map and asset/location reference fields. This does not happen in Chrome.

jgaehring commented 4 years ago

I just created a farm-tabs component on the field-module branch (0aa4164) which should make it a little easier to isolate what's going on with the tabs and fix this behavior. I think it should just be a matter of calling .scrollTo(0, 0) on the main .tab-container element whenever a tab is switched, although it might be nice to implement a scroll "memory" for each tab, so as you switch back and forth between them.

It's not strictly pertinent to this bug, but another feature I'll still need to reimplement in the farm-tabs component is the ability to go straight to a tab upon mounting the component, which is currently inside the EditLog component:

https://github.com/farmOS/farmOS-client/blob/cf6a1d00c3b2bcda74e92e3522a1d4a743c181d0/src/field-modules/my-logs/components/EditLog.vue#L602-L606

jgaehring commented 4 years ago

I realized that the new farm-tabs would have this behavior no matter the browser, b/c of how I refactored it, so I just went ahead and banged this out.

although it might be nice to implement a scroll "memory" for each tab, so as you switch back and forth between them.

Implemented this "scroll memory" behavior while I was at it too. Works nicely!

This is on the field-module branch, so it may not be merged for a little while, but I'm going to close it now so I don't forget to later.

jgaehring commented 4 years ago

I just remembered this still will need to be applied to the EditLog screen, by incorporating the farm-tabs component there, so I'm reopening.

jgaehring commented 4 years ago

Resolved by 8a27dd4.