feat(minimap): add prop to configure the minimap title

This commit is contained in:
Christopher Möller
2022-11-07 13:55:20 +01:00
parent 0b80eadb4a
commit 52816debba
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -38,7 +38,6 @@ const selector = (s: ReactFlowState) => {
const getAttrFunction = (func: any): GetMiniMapNodeAttribute => (func instanceof Function ? func : () => func);
const ARIA_LABEL_KEY = 'react-flow__minimap-desc';
function MiniMap({
style,
className,
@@ -53,6 +52,7 @@ function MiniMap({
onNodeClick,
pannable = false,
zoomable = false,
ariaLabel = 'React Flow mini map',
}: MiniMapProps) {
const store = useStoreApi();
const svg = useRef<SVGSVGElement>(null);
@@ -155,7 +155,7 @@ function MiniMap({
ref={svg}
onClick={onSvgClick}
>
<title id={labelledBy}>React Flow mini map</title>
<title id={labelledBy}>{ariaLabel}</title>
{nodes.map((node) => {
return (
<MiniMapNode
+1
View File
@@ -16,4 +16,5 @@ export type MiniMapProps<NodeData = any> = Omit<HTMLAttributes<SVGSVGElement>, '
onNodeClick?: (event: MouseEvent, node: Node<NodeData>) => void;
pannable?: boolean;
zoomable?: boolean;
ariaLabel?: string;
};