浏览代码

fix(ts): Pagination,Tooltip,ResizeObserver (#331)

走鹃 3 年之前
父节点
当前提交
7d8db8212b

+ 1 - 1
packages/semi-ui/pagination/index.tsx

@@ -286,7 +286,7 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
                     className={`${prefixCls}-quickjump-input-number`}
                     className={`${prefixCls}-quickjump-input-number`}
                     hideButtons
                     hideButtons
                     disabled={isDisabled}
                     disabled={isDisabled}
-                    onBlur={(e: React.MouseEvent) => this.foundation.handleQuickJumpBlur()}
+                    onBlur={(e: React.FocusEvent) => this.foundation.handleQuickJumpBlur()}
                     onEnterPress={(e: React.KeyboardEvent) => this.foundation.handleQuickJumpEnterPress((e.target as any).value)}
                     onEnterPress={(e: React.KeyboardEvent) => this.foundation.handleQuickJumpEnterPress((e.target as any).value)}
                     onChange={(v: string | number) => this.foundation.handleQuickJumpNumberChange(v)}
                     onChange={(v: string | number) => this.foundation.handleQuickJumpNumberChange(v)}
                 />
                 />

+ 1 - 1
packages/semi-ui/resizeObserver/index.tsx

@@ -107,7 +107,7 @@ export default class ReactResizeObserver extends BaseComponent<ReactResizeObserv
 
 
     render() {
     render() {
         const child = React.Children.only(this.props.children);
         const child = React.Children.only(this.props.children);
-        const { ref } = child as React.ComponentPropsWithRef<any>;
+        const { ref } = child as any;
         return React.cloneElement(child as React.ReactElement, {
         return React.cloneElement(child as React.ReactElement, {
             ref: (node: HTMLDivElement) => this.mergeRef(ref, node),
             ref: (node: HTMLDivElement) => this.mergeRef(ref, node),
         });
         });

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

@@ -622,7 +622,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
                 // Keep your own reference
                 // Keep your own reference
                 (this.triggerEl as any).current = node;
                 (this.triggerEl as any).current = node;
                 // Call the original ref, if any
                 // Call the original ref, if any
-                const { ref } = children as React.ComponentPropsWithRef<any>;
+                const { ref } = children as any;
                 // this.log('tooltip render() - get ref', ref);
                 // this.log('tooltip render() - get ref', ref);
                 if (typeof ref === 'function') {
                 if (typeof ref === 'function') {
                     ref(node);
                     ref(node);