@@ -141,7 +141,7 @@ class ReactTooltip extends React.Component {
141
141
* For unify the bind and unbind listener
142
142
*/
143
143
bind ( methodArray ) {
144
- methodArray . forEach ( method => {
144
+ methodArray . forEach ( ( method ) => {
145
145
this [ method ] = this [ method ] . bind ( this ) ;
146
146
} ) ;
147
147
}
@@ -158,7 +158,7 @@ class ReactTooltip extends React.Component {
158
158
static getDerivedStateFromProps ( nextProps , prevState ) {
159
159
const { ariaProps } = prevState ;
160
160
const newAriaProps = parseAria ( nextProps ) ;
161
- const isChanged = Object . keys ( newAriaProps ) . some ( props => {
161
+ const isChanged = Object . keys ( newAriaProps ) . some ( ( props ) => {
162
162
return newAriaProps [ props ] !== ariaProps [ props ] ;
163
163
} ) ;
164
164
if ( ! isChanged ) {
@@ -254,8 +254,8 @@ class ReactTooltip extends React.Component {
254
254
255
255
// Scan document for shadow DOM elements
256
256
nodeListToArray ( document . getElementsByTagName ( '*' ) )
257
- . filter ( element => element . shadowRoot )
258
- . forEach ( element => {
257
+ . filter ( ( element ) => element . shadowRoot )
258
+ . forEach ( ( element ) => {
259
259
targetArray = targetArray . concat (
260
260
nodeListToArray ( element . shadowRoot . querySelectorAll ( selector ) )
261
261
) ;
@@ -273,7 +273,7 @@ class ReactTooltip extends React.Component {
273
273
const { id, globalEventOff, isCapture } = this . props ;
274
274
const targetArray = this . getTargetArray ( id ) ;
275
275
276
- targetArray . forEach ( target => {
276
+ targetArray . forEach ( ( target ) => {
277
277
if ( target . getAttribute ( 'currentItem' ) === null ) {
278
278
target . setAttribute ( 'currentItem' , 'false' ) ;
279
279
}
@@ -286,7 +286,7 @@ class ReactTooltip extends React.Component {
286
286
if ( this . isBodyMode ( ) ) {
287
287
this . bindBodyListener ( targetArray ) ;
288
288
} else {
289
- targetArray . forEach ( target => {
289
+ targetArray . forEach ( ( target ) => {
290
290
const isCaptureMode = this . isCapture ( target ) ;
291
291
const effect = this . getEffect ( target ) ;
292
292
if ( this . isCustomEvent ( target ) ) {
@@ -327,7 +327,7 @@ class ReactTooltip extends React.Component {
327
327
this . unbindBodyListener ( ) ;
328
328
} else {
329
329
const targetArray = this . getTargetArray ( id ) ;
330
- targetArray . forEach ( target => {
330
+ targetArray . forEach ( ( target ) => {
331
331
this . unbindBasicListener ( target ) ;
332
332
if ( this . isCustomEvent ( target ) ) this . customUnbindListener ( target ) ;
333
333
} ) ;
@@ -389,7 +389,7 @@ class ReactTooltip extends React.Component {
389
389
if ( isGlobalCall ) {
390
390
// Don't trigger other elements belongs to other ReactTooltip
391
391
const targetArray = this . getTargetArray ( this . props . id ) ;
392
- const isMyElement = targetArray . some ( ele => ele === e . currentTarget ) ;
392
+ const isMyElement = targetArray . some ( ( ele ) => ele === e . currentTarget ) ;
393
393
if ( ! isMyElement ) return ;
394
394
}
395
395
// Get the tooltip content
@@ -641,7 +641,7 @@ class ReactTooltip extends React.Component {
641
641
if ( hasTarget ) {
642
642
// Don't trigger other elements belongs to other ReactTooltip
643
643
const targetArray = this . getTargetArray ( this . props . id ) ;
644
- const isMyElement = targetArray . some ( ele => ele === e . currentTarget ) ;
644
+ const isMyElement = targetArray . some ( ( ele ) => ele === e . currentTarget ) ;
645
645
if ( ! isMyElement || ! this . state . show ) return ;
646
646
}
647
647
@@ -703,14 +703,8 @@ class ReactTooltip extends React.Component {
703
703
704
704
// Calculation the position
705
705
updatePosition ( callbackAfter ) {
706
- const {
707
- currentEvent,
708
- currentTarget,
709
- place,
710
- desiredPlace,
711
- effect,
712
- offset
713
- } = this . state ;
706
+ const { currentEvent, currentTarget, place, desiredPlace, effect, offset } =
707
+ this . state ;
714
708
const node = this . tooltipRef ;
715
709
const result = getPosition (
716
710
currentEvent ,
@@ -742,7 +736,7 @@ class ReactTooltip extends React.Component {
742
736
}
743
737
744
738
if ( callbackAfter && typeof callbackAfter === 'function' ) {
745
- callbackAfter ( ) ;
739
+ callbackAfter ( ) ;
746
740
}
747
741
748
742
// Set tooltip position
@@ -775,7 +769,7 @@ class ReactTooltip extends React.Component {
775
769
hasCustomColors ( ) {
776
770
return Boolean (
777
771
Object . keys ( this . state . customColors ) . find (
778
- color => color !== 'border' && this . state . customColors [ color ]
772
+ ( color ) => color !== 'border' && this . state . customColors [ color ]
779
773
) ||
780
774
( this . state . border && this . state . customColors [ 'border' ] )
781
775
) ;
@@ -820,7 +814,7 @@ class ReactTooltip extends React.Component {
820
814
< Wrapper
821
815
className = { `${ wrapperClassName } ` }
822
816
id = { this . props . id || uuid }
823
- ref = { ref => ( this . tooltipRef = ref ) }
817
+ ref = { ( ref ) => ( this . tooltipRef = ref ) }
824
818
{ ...ariaProps }
825
819
data-id = "tooltip"
826
820
dangerouslySetInnerHTML = { { __html : htmlContent } }
@@ -832,7 +826,7 @@ class ReactTooltip extends React.Component {
832
826
className = { `${ wrapperClassName } ` }
833
827
id = { this . props . id || uuid }
834
828
{ ...ariaProps }
835
- ref = { ref => ( this . tooltipRef = ref ) }
829
+ ref = { ( ref ) => ( this . tooltipRef = ref ) }
836
830
data-id = "tooltip"
837
831
>
838
832
< style
0 commit comments