In general, nothing should be installed in the same space as lead-acid batteries. I’ll bet you a case of
beer that the instruction manual for you charger says that.
There are two risks.
First is the highly corrosive fumes of sulfuric acid. They rapidly destroy
electronics.
Second, off gases from batteries are hydrogen, and are highly explosive when mixed with air. Any kind of sparks or potential sparks should be avoided. Sparks like would be caused by a gfi switching, or a plug being connected or disconnected.
These risks are much lower with valve regulated batteries like
AGM or GEL, but still not zero.
And other
advice given here is wrong. The vent from a
battery box is at the TOP of the box not the bottom. Hydrogen is much lighter than air, unlike
propane where the situation is reversed.