@@ -57,6 +57,7 @@ const propTypes = {
5757 ] ) ,
5858 disabledTabClassName : PropTypes . string ,
5959 disableUpDownKeys : PropTypes . bool ,
60+ disableLeftRightKeys : PropTypes . bool ,
6061 domRef : PropTypes . func ,
6162 focus : PropTypes . bool ,
6263 forceRenderTabPanel : PropTypes . bool ,
@@ -256,7 +257,7 @@ const UncontrolledTabs = (props) => {
256257 }
257258
258259 function handleKeyDown ( e ) {
259- const { direction, disableUpDownKeys } = props ;
260+ const { direction, disableUpDownKeys, disableLeftRightKeys } = props ;
260261 if ( isTabFromContainer ( e . target ) ) {
261262 let { selectedIndex : index } = props ;
262263 let preventDefault = false ;
@@ -276,8 +277,8 @@ const UncontrolledTabs = (props) => {
276277 // keyCode is deprecated and only used here for IE
277278
278279 if (
279- e . code === 'ArrowLeft' ||
280- e . keyCode === 37 /* arrow left */ ||
280+ ( ! disableLeftRightKeys &&
281+ ( e . keyCode === 37 || e . code === 'ArrowLeft' ) ) /* arrow left */ ||
281282 ( ! disableUpDownKeys &&
282283 ( e . keyCode === 38 || e . code === 'ArrowUp' ) ) /* arrow up */
283284 ) {
@@ -290,8 +291,8 @@ const UncontrolledTabs = (props) => {
290291 preventDefault = true ;
291292 useSelectedIndex = true ;
292293 } else if (
293- e . code === 'ArrowRight' ||
294- e . keyCode === 39 /* arrow right */ ||
294+ ( ! disableLeftRightKeys &&
295+ ( e . keyCode === 39 || e . code === 'ArrowRight' ) ) /* arrow right */ ||
295296 ( ! disableUpDownKeys &&
296297 ( e . keyCode === 40 || e . code === 'ArrowDown' ) ) /* arrow down */
297298 ) {
@@ -380,6 +381,7 @@ const UncontrolledTabs = (props) => {
380381 selectedTabPanelClassName, // unused
381382 environment, // unused
382383 disableUpDownKeys, // unused
384+ disableLeftRightKeys, // unused
383385 ...attributes
384386 } = props ;
385387 return (
0 commit comments