File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
packages/docusaurus-theme-openapi-docs/src/theme/SchemaTabs Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import React, {
11
11
useEffect ,
12
12
useState ,
13
13
ReactElement ,
14
+ LegacyRef ,
14
15
} from "react" ;
15
16
16
17
import {
@@ -99,14 +100,18 @@ function TabList({
99
100
} ;
100
101
} , [ ] ) ;
101
102
102
- const handleRightClick = ( e ) => {
103
+ const handleRightClick = ( e : any ) => {
103
104
e . preventDefault ( ) ;
104
- tabItemListContainerRef . current . scrollLeft += 90 ;
105
+ if ( tabItemListContainerRef . current ) {
106
+ tabItemListContainerRef . current . scrollLeft += 90 ;
107
+ }
105
108
} ;
106
109
107
- const handleLeftClick = ( e ) => {
110
+ const handleLeftClick = ( e : any ) => {
108
111
e . preventDefault ( ) ;
109
- tabItemListContainerRef . current . scrollLeft -= 90 ;
112
+ if ( tabItemListContainerRef . current ) {
113
+ tabItemListContainerRef . current . scrollLeft -= 90 ;
114
+ }
110
115
} ;
111
116
112
117
return (
@@ -118,7 +123,7 @@ function TabList({
118
123
/>
119
124
) }
120
125
< ul
121
- ref = { tabItemListContainerRef }
126
+ ref = { tabItemListContainerRef as LegacyRef < HTMLUListElement > }
122
127
role = "tablist"
123
128
aria-orientation = "horizontal"
124
129
className = { clsx (
You can’t perform that action at this time.
0 commit comments