Welcome to the forum
You should check this
a
p
containingPosition:
and the position of the player.
Although it does not seem to make a difference here.
I’ll need to check some other threads but I think it might have to do with hiding/showing divs instead of fully removing them
EDIT: It’s not that you are doing it correctly: