Browse Source

fix: fixed Table onMouseLeave callback bug (#1794)

Co-authored-by: shijia.me <[email protected]>
Shi Jia 2 years ago
parent
commit
3540ac46ec
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/semi-ui/table/Body/BaseRow.tsx

+ 2 - 2
packages/semi-ui/table/Body/BaseRow.tsx

@@ -294,7 +294,7 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
 
         const customRowProps = this.adapter.getCache('customRowProps');
 
-        if (typeof customRowProps.onMouseEnter === 'function') {
+        if (typeof customRowProps?.onMouseEnter === 'function') {
             customRowProps.onMouseEnter(e);
         }
     };
@@ -304,7 +304,7 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
 
         const customRowProps = this.adapter.getCache('customRowProps');
 
-        if (typeof customRowProps.onMouseLeave === 'function') {
+        if (typeof customRowProps?.onMouseLeave === 'function') {
             customRowProps.onMouseLeave(e);
         }
     };