This is kinda complicated and hard to explain so I apologise in advance.
Bug appears to be new in patch 1.18 experimental, I cannot replicate in 1.17. (at least most of it - see end of post)
Basically what happens is that when you scroll down your inventory and then take items in/out of your hands in certain conditions, your inventory will teleport back to the top.
What I can say for sure is that if an item is on your shoulder (firearm/melee weapon) and you EQUIP it, the inventory will reset back to the top 100% of the time.
HOWEVER - if the item is a firearm and its attachment slots are HIDDEN, then the inventory will remain in place only when UNEQUIPPING it.
If you EQUIP a firearm while its attachment slots are VISIBLE, then your inventory can become bugged and display a hidden 'fake section' at the very bottom below your backpack (you can keep scrolling a bit further than you're supposed to be able to) when your inventory is in this bugged state with the 'fake section' UNEQUIPPING a firearm will NOT reset the position of your inventory, it will function as normal.
Here is how you can replicate this invisible/fake area at the bottom of the inventory. (Also present in 1.17, but inventory works fine on that patch)
- Pick up firearm and put it on your shoulder slot
- Make sure the attachment slots of the firearm are visible in the inventory
- Equip the firearm
- Scroll all the way down to the bottom of the inventory, and you will notice a 'fake' section has appeared, and you can now scroll down a little bit further than normal.
- Put the firearm back on your shoulder, the inventory will teleport to the top and when you scroll back down you will notice this fake section will be gone
- If you equip the firearm again, the fake section will NOT appear
- Unequip the firearm once more
- Equip firearm again and notice the fake section has appeared again.. this fake section will always appear every SECOND time you equip the firearm, as long as the attachment slots are showing.
So just to recap what I've tested -
- Equipping shoulder slot item will reset position of inventory 100% of the time (firearm + melee)
- Unequipping a firearm with its attachment slots hidden will keep the inventory in place 100% of the time
- Unequipping a firearm with its attachment slots visible WHILE NOT in the bugged 'fake section' will reset the inventory back to the top 100% of the time
- If you unequip a firearm while the inventory is in the bugged 'fake' state, then the inventory will remain in place 100% of the time.
- Unequipping a melee weapon will keep the inventory in place 100% of the time (I suspect because they don't have any attachment slots to begin with)
- Chambering a firearm or loading a magazine into it will reset the position of inventory 100% of the time (pistol + rifle)
- Same thing can apply with other items as well, such as attaching/detaching a radio to your backpack, though I'm unsure of the conditions for that to happen, I stopped testing at this point as it's a bit of a clusterfuck..
That should all be correct but I apologise if there's any errors, it got a bit confusing as I'm sure you can tell, hopefully it helps.
The only part of this that I can replicate on patch 1.17 is the 'fake section' at the bottom of the inventory, which will happen when equipping a shoulder slot weapon with its attachments showing, however it will go away after you scroll the mouse wheel and the inventory position is never reset, so basically it isn't an issue on 1.17.