File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -643,6 +643,9 @@ const Tooltip = ({
643643 const newId = ( mutation . target as HTMLElement ) . getAttribute ( 'data-tooltip-id' )
644644 if ( newId === id ) {
645645 newAnchors . push ( mutation . target as HTMLElement )
646+ } else if ( mutation . oldValue === id ) {
647+ // data-tooltip-id has now been changed, so we need to remove this anchor
648+ removedAnchors . push ( mutation . target as HTMLElement )
646649 }
647650 }
648651 if ( mutation . type !== 'childList' ) {
@@ -727,6 +730,8 @@ const Tooltip = ({
727730 subtree : true ,
728731 attributes : true ,
729732 attributeFilter : [ 'data-tooltip-id' ] ,
733+ // to track the prev value if we need to remove anchor when data-tooltip-id gets changed
734+ attributeOldValue : true ,
730735 } )
731736 return ( ) => {
732737 documentObserver . disconnect ( )
You can’t perform that action at this time.
0 commit comments