From 3ee674d92bdd6f26b80230c82ef93139c9e71879 Mon Sep 17 00:00:00 2001 From: Ian Bottomley Date: Fri, 22 Mar 2024 13:17:47 +0000 Subject: [PATCH] Adds tabIndex as a prop and passes it to the map div --- src/RMap.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RMap.tsx b/src/RMap.tsx index d5941047..b00d753d 100644 --- a/src/RMap.tsx +++ b/src/RMap.tsx @@ -98,6 +98,8 @@ export interface RMapProps extends PropsWithChildren { minZoom?: number; /** Maximum zoom level */ maxZoom?: number; + /** Sets the tabIndex of the map, if set the map will need to be focused for mouse zoom to work */ + tabIndex?: number; /** * Allow rotation of the map. * Cannot be updated once the map is created. @@ -188,6 +190,7 @@ export default class RMap extends RlayersBase> className={this.props.className} style={{width: this.props.width, height: this.props.height}} ref={this.target} + tabIndex={this.props.tabIndex} > {this.props.children}