E-mail List Archives
Re: [Web Component Development] How can I block the click event of the custom disabled elements?
From: Patrick H. Lauke
Date: Mar 16, 2021 4:42AM
- Next message: Miriam Fukushima: "table cells, th-mapping"
- Previous message: Mohith BP: "Thoughts on using role group versus role table for simple sortable data table"
- Next message in Thread:
: "Re: [Web Component Development] How can I block the click event of the custom disabled elements?" - Previous message in Thread:
: "[Web Component Development] How can I block the click event of the custom disabled elements?" - View all messages in this Thread
On 16/03/2021 10:34, ë°ì ì§ wrote:
> When the HTML native button is disabled, We can't activate it in any way.
> We tried a few ways to make the disabled custom button unclickable.
Presumably you have an actual function/handler hanging off of your
click? In that case, make the function itself check if the event target
that triggered the function is currently set to `aria-disabled`, and if
that's the case, bail out and don't execute whatever the function is
supposed to do?
function doIt(e) {
if (e.target.getAttribute('aria-disabled') == "true") {
return;
}
/* the actual thing that's supposed to happen on click */
}
P
--
Patrick H. Lauke
https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke
- Next message: Miriam Fukushima: "table cells, th-mapping"
- Previous message: Mohith BP: "Thoughts on using role group versus role table for simple sortable data table"
- Next message in Thread:
: "Re: [Web Component Development] How can I block the click event of the custom disabled elements?" - Previous message in Thread:
: "[Web Component Development] How can I block the click event of the custom disabled elements?" - View all messages in this Thread