'How to disable each button based on some condition in speed dial material UI react js?
I have been trying to disable the actions button in speeddial based on some condition, but cant find anything to put inside the actions to disable the particular button based on the condition, sharing the code below, any help would be much appreciated.
<SpeedDial
ariaLabel="SpeedDial Component Demo"
style={{
left: 125,
bottom: 125,
position: 'absolute',
}}
icon={<SpeedDialIcon openIcon={<EditIcon />} />}
onClose={() => {
setOpen(false);
}}
onOpen={() => {
setOpen(true);
}}
open={open}
>
{[
{ icon: <ShareIcon />, name: 'Share' },
{ icon: <PrintIcon />, name: 'Print' },
].map((action) => (
<SpeedDialAction
icon={action.icon}
key={action.name}
onClick={() => {
setOpen(false);
}}
tooltipTitle={action.name}
tooltipOpen
onClick={handleClose}
/>
))}
</SpeedDial>
Here I want the share and print button to stay disabled until they satisfy some condition. thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
