Bläddra i källkod

fix: tooltip dont't wrap span when trigger is custom, close #919

pointhalo 3 år sedan
förälder
incheckning
3c0786c89c
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      packages/semi-ui/tooltip/index.tsx

+ 4 - 1
packages/semi-ui/tooltip/index.tsx

@@ -664,7 +664,10 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
                 }
 
                 children = cloneElement(children as React.ReactElement, { style: childrenStyle });
-                children = this.wrapSpan(children);
+                if (trigger !== 'custom') {
+                    // no need to wrap span when trigger is custom, cause it don't need bind event
+                    children = this.wrapSpan(children);
+                }
                 this.isWrapped = true;
             } else if (!isValidElement(children)) {
                 children = this.wrapSpan(children);