custom button bug

custom button bug

Hello, I am using a custom button to validate a field with my api, but I have noticed that sometimes the button does not work, you have to make several attempts until it returns.

Sometimes it doesn't return anything and just refreshes the page

I will upload a gif with the demonstration of the problem