A sliding mechanism includes two members, one of which is slidable with respect to the other along an axis. One of the members slides back and forth with respect to the other between a first position and a second position. A leaf spring is used as a positioning element to hold one of the members in either the first position or the second position. The leaf spring is attached to one of the two members and the other of the two members includes a projection. The leaf spring abuts the projection holding the slidable member in either the first position or the second position. When a user pushes one of the members from one position to another, the projection pushes the leaf spring out of the way until it passes an apex of the leaf spring and is held in the other position.