I want to freeze Y position of an object while using steam VR.

I am trying to freeze the Y position of my chair in scene so that I am only able to push or pull the chair and not lift it. I have added rigidbody and applied freeze position constraint to Y but still I am able to lift it. Help me with this.

Untested Code

   public Transform chair;
    public Vector3 lock;
    
    void Start
    {
    lock = chair.transform.position;
    }
    void Update
    {
    chair.transform.position.y=lock.y;
    }