How to make an UI element clickable based on its fill amount?

I have a problem and have followed this answer. I’m trying to make a UI Toggle to be clickeable only in the visible area it has ignoring the transparency. What I try to do is to set the ‘Image Type’ to ‘Filled’ and reduce its ‘Fill Amount’ in the ‘Image’ component.

The following code from the answer worked for me but having the ‘Image Type’ on ‘Simple’:

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI; // Required when Using UI elements.
 
 public class AlphaButton : MonoBehaviour
 {
     public float AlphaThreshold = 0.1f;
 
     void Start()
     {
         this.GetComponent<Image>().alphaHitTestMinimumThreshold = AlphaThreshold;
     }
 }

But when I change to ‘Filled’ what I see is it just ignores the alpha from the original image but not the transparency added when I reduce the ‘Fill Amount’. How can I solve this?

Got the answer in this 1.