File tree Expand file tree Collapse file tree
src/plugins/moreButtonPlugin/button Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ export default function Button(getDeps, props) {
55 const [ open , setOpen ] = useState ( false ) ;
66 const closePopper = useCallback ( ( ) => setOpen ( false ) , [ ] ) ;
77 const btnRef = useRef ( ) ;
8- const popperRef = useRef ( ) ;
98 const ref = useRef ( ) ;
109 props . components . useForceUpdate ( ) ;
1110 ref . current = ref . current || Api . call ( props . instance , props . components ) ;
@@ -34,7 +33,7 @@ export default function Button(getDeps, props) {
3433 < div { ...ref . current . btnPropsGenerator ( onClick , btnRef , open ) } >
3534 < IconComponent instance = { props . instance } />
3635 </ div >
37- { open ? < Popper { ...props } TabsComponent = { ref . current . TabsComponent } ref = { popperRef } btnRef = { btnRef } /> : null }
36+ { open ? < Popper { ...props } TabsComponent = { ref . current . TabsComponent } btnRef = { btnRef } /> : null }
3837 </ >
3938 ) ;
4039}
Original file line number Diff line number Diff line change 1- import { forwardRef } from 'react' ;
21import createPopper from './createPopper.js' ;
32import getPopperMaxHeight from './getPopperMaxHeight.js' ;
43import getClassName from './getClassName.js' ;
@@ -12,4 +11,4 @@ const getDeps = () => ({
1211 getClassName,
1312 clk,
1413} ) ;
15- export default forwardRef ( Popper . bind ( null , getDeps ) ) ;
14+ export default Popper . bind ( null , getDeps ) ;
Original file line number Diff line number Diff line change 1- import React , { useLayoutEffect } from 'react' ;
1+ import React , { useLayoutEffect , useRef } from 'react' ;
22import PropTypes from 'prop-types' ;
3- export default function Popper ( getDeps , props , popperRef ) {
4- const { createPopper, getPopperMaxHeight, getClassName, clk} = getDeps ( ) ;
5- const { TabsComponent, instance, hiddenTabIDs, btnRef} = props ;
3+ export default function Popper ( getDeps , props ) {
4+ const { createPopper, getPopperMaxHeight, getClassName, clk } = getDeps ( ) ;
5+ const { TabsComponent, instance, hiddenTabIDs, btnRef } = props ;
6+ const popperRef = useRef ( ) ;
67 useLayoutEffect ( ( ) => {
78 popperRef . current . style . maxHeight = getPopperMaxHeight ( btnRef . current , 15 ) + 'px' ;
89 const popperIns = createPopper ( btnRef . current , popperRef . current ) ;
910 return ( ) => {
1011 popperIns . destroy ( ) ;
1112 } ;
1213 } , [ ] ) ;
13- const { selectedTabID} = instance . getData ( ) ;
14+ const { selectedTabID } = instance . getData ( ) ;
1415 const openedTabIDs = hiddenTabIDs ? hiddenTabIDs . split ( ',' ) : [ ] ;
1516 return (
1617 < >
You can’t perform that action at this time.
0 commit comments