When your door won’t stay closed, your enclosure, or its sill, is usually not level. This can sometimes translate into the orientation of the top track being slightly askew.
A level enclosure and sill are important for the sliding shower doors to operate correctly. Check the sill with a bubble level - if bubble is just slightly off center, it means the unit is not level. Delta® shower doors are designed to accommodate out of plumb conditions, but not for unlevel units.
Keep in mind that if your unit is not level, it's best to enlist a contractor to give viable solutions.