This happens with time and age. It is a simple mechanical float mechanism inside the tank. Problem is to repair it would require time and work and most likely not worth it.
If you have a rectangular hole under the front of the seat with a slider that goes up & down to show the fuel level the usual culprit is the plastic bracket the fuel tank sits on
You will have to remove both rear wheels to get to it
Some times the spring stretches but usually the bracket breaks off on the right side where it bolts to the frame.