Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

icon makes the button not clickable

I have a button, on which I have an absolute positioned search icon. the Button is working fine on the edges but not on an icon. The button is unclickable for the entire portion of the search icon.

button with a absolute positioned icon

code for Icon placement

.custom-position {
right: 32px;
position: absolute;
top: 27%;}

Is it possible to make the button clickable on the places where the icon is occupying space?

like image 496
ad08 Avatar asked Sep 15 '26 16:09

ad08


1 Answers

You could try adding: pointer-events: none to your icon/image.

Example:

.custom-position {
  right: 32px;
  position: absolute;
  top: 27%;
  pointer-events: none;
}

pointer-events docs

like image 136
segFault Avatar answered Sep 18 '26 06:09

segFault



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!