refactor(controls): add titles for buttons

This commit is contained in:
moklick
2022-01-18 15:49:18 +01:00
parent 660ec00be5
commit 97b5327e1e
+24 -4
View File
@@ -90,21 +90,41 @@ const Controls: FC<ControlProps> = ({
<div className={mapClasses} style={style}> <div className={mapClasses} style={style}>
{showZoom && ( {showZoom && (
<> <>
<ControlButton onClick={onZoomInHandler} className="react-flow__controls-zoomin"> <ControlButton
onClick={onZoomInHandler}
className="react-flow__controls-zoomin"
title="zoom in"
aria-label="zoom in"
>
<PlusIcon /> <PlusIcon />
</ControlButton> </ControlButton>
<ControlButton onClick={onZoomOutHandler} className="react-flow__controls-zoomout"> <ControlButton
onClick={onZoomOutHandler}
className="react-flow__controls-zoomout"
title="zoom out"
aria-label="zoom out"
>
<MinusIcon /> <MinusIcon />
</ControlButton> </ControlButton>
</> </>
)} )}
{showFitView && ( {showFitView && (
<ControlButton className="react-flow__controls-fitview" onClick={onFitViewHandler}> <ControlButton
className="react-flow__controls-fitview"
onClick={onFitViewHandler}
title="fit view"
aria-label="fit view"
>
<FitviewIcon /> <FitviewIcon />
</ControlButton> </ControlButton>
)} )}
{showInteractive && ( {showInteractive && (
<ControlButton className="react-flow__controls-interactive" onClick={onInteractiveChangeHandler}> <ControlButton
className="react-flow__controls-interactive"
onClick={onInteractiveChangeHandler}
title="toggle interactivity"
aria-label="toggle interactivity"
>
{isInteractive ? <UnlockIcon /> : <LockIcon />} {isInteractive ? <UnlockIcon /> : <LockIcon />}
</ControlButton> </ControlButton>
)} )}