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 = ({
643
643
const newId = ( mutation . target as HTMLElement ) . getAttribute ( 'data-tooltip-id' )
644
644
if ( newId === id ) {
645
645
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 )
646
649
}
647
650
}
648
651
if ( mutation . type !== 'childList' ) {
@@ -727,6 +730,8 @@ const Tooltip = ({
727
730
subtree : true ,
728
731
attributes : true ,
729
732
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 ,
730
735
} )
731
736
return ( ) => {
732
737
documentObserver . disconnect ( )
You can’t perform that action at this time.
0 commit comments