Button's onClick.Invoke() called more than once and it's a problem

Hello, I am working on a VR project that uses Raycast for UI interactions. The raycast part (selecting, hovering over and triggering a button) works fine. My problem comes with the pressure of the button :

When I aim at a button and press the trigger I use the onClick.invoke() method (on a Smartphone UI that I created in the scene : the user can compose a number of 10 digits and call it) , it is supposed to be called once, when the user presses the trigger on the number he wants to add. He should be able to do so until he reachs the 10 digits limit, one number at a time, after each trigger pressure.

But for now, as soon as I press the trigger, the line is fullfilled with the same button that I pressed only once. So if I press the button “2” I got “2222222222” instead of just “2” on the number line.

My guess is that onClick is called multiple times and not juste once, when I press the trigger. Any solution for that ?

void Update()
    {
        RayForUI();
    }

    //-------------------------------------------------

    private void RayForUI()
    {
        RaycastHit hit;

        if(Physics.Raycast(rayCastStartPoint.position, rayCastStartPoint.forward, out hit, raycastMaxDistance, RaycastCollidableLayers))
        {
            if (hit.collider != null)
            {
                if (hit.collider.CompareTag("UIElement") )
                {
                    button = hit.collider.GetComponent<Button>();                 

                    //[...] some code that displays a line to represent the raycast

                    if (button != null)
                    {                        
                        //[...] some code that changes the color of the button on hover

                        if (SteamVR_Input._default.inActions.GrabPinch.GetStateDown(hand))
                        {
                              bt.onClick.Invoke();
                        }
                    }
                }
            }
        }
    }

private bool lastGrabPinchStateDown ;

// ...

 private void RayForUI()
 {
     RaycastHit hit;

     bool grabPinchStateDown = SteamVR_Input._default.inActions.GrabPinch.GetStateDown(hand);
     if(Physics.Raycast(rayCastStartPoint.position, rayCastStartPoint.forward, out hit, raycastMaxDistance, RaycastCollidableLayers))
     {
         if (hit.collider != null)
         {
             if (hit.collider.CompareTag("UIElement") )
             {
                 button = hit.collider.GetComponent<Button>();                 

                 //[...] some code that displays a line to represent the raycast

                 if (button != null)
                 {                        
                     //[...] some code that changes the color of the button on hover

                     if ( grabPinchStateDown && !lastGrabPinchStateDown )
                     {
                         bt.onClick.Invoke();
                     }
                 }
             }
         }
     }
     lastGrabPinchStateDown = grabPinchStateDown ;
 }

you have it in the update so if you want to call it only once, you need to create a bool and in in the update

if (button != null && !myCondition)
                  {                        
                      //[...] some code that changes the color of the button on hover
 
                      if ( grabPinchStateDown && !lastGrabPinchStateDown )
                      {
                          myCondition = true;
                          bt.onClick.Invoke();
                      }
                  }
              }
          }
      }