Disable onclick if the disable props is active (#123)

This commit is contained in:
Yohan Boogaert 2021-09-14 14:58:08 +02:00 committed by GitHub
parent 0d10d73d6b
commit a5e7fadf4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,7 +124,7 @@ impl Component for MenuItem {
)
href={(!self.props.disabled).then(|| self.props.href.clone())}.flatten()
tabIndex={(!self.props.disabled).then(|| "0")}
onclick={self.props.onclick.clone()}
onclick={(!self.props.disabled).then(|| self.props.onclick.clone())}
>
{
if let Some(icon_name) = self.props.icon {