I am wanting to disable the default behaviour of Material-UI's SpeedDial component (https://material-ui.com/api/speed-dial/).
Currently when you click a SpeedDialAction, the parent SpeedDial component will close.
I would like to change the behaviour so that when a SpeedDialAction is clicked the parent SpeedDial component will stay open.
Is there a simple way for me to disable the 'closing' behaviour?
Thanks!
The
SpeedDialcomponent's open state is controlled via the propopen. The default example for theSpeedDialhas the followingonClickfunction on theSpeedDialActioncomponent:setOpensets theopenstate tofalsewhen an item is clicked, and this state is passed to theSpeedDialcomponent causing it to close.So, just don't set this state in the
onClick, and yourSpeedDialwill remain open. :)