The floating thing that you are talking about is called a ball valve - as it rises it compresses a rubber washer against the water inlet, so stopping the flow. The washer has failed, so you can either replace just the washer - several different types though - or have a complete new fill valve fitted.
John
April 2009