@@ -10,7 +10,7 @@ import devWarning from '../../vc-util/devWarning';
1010import useMergedState from '../../_util/hooks/useMergedState' ;
1111import useState from '../../_util/hooks/useState' ;
1212import type { Ref } from 'vue' ;
13- import { computed , shallowRef , watchEffect } from 'vue' ;
13+ import { computed , shallowRef } from 'vue' ;
1414import type { CheckboxProps } from '../../checkbox' ;
1515import Checkbox from '../../checkbox' ;
1616import Dropdown from '../../dropdown' ;
@@ -167,12 +167,14 @@ export default function useSelection<RecordType>(
167167 // Save last selected key to enable range selection
168168 const [ lastSelectedKey , setLastSelectedKey ] = useState < Key | null > ( null ) ;
169169
170- // Reset if rowSelection reset
171- watchEffect ( ( ) => {
172- if ( ! rowSelectionRef . value ) {
173- setMergedSelectedKeys ( [ ] ) ;
174- }
175- } ) ;
170+ // // Reset if rowSelection reset
171+ // we use computed to reset, donot need setMergedSelectedKeys again like react
172+ // https://github.com/vueComponent/ant-design-vue/issues/4885
173+ // watchEffect(() => {
174+ // if (!rowSelectionRef.value) {
175+ // setMergedSelectedKeys([]);
176+ // }
177+ // });
176178
177179 const setSelectedKeys = ( keys : Key [ ] ) => {
178180 let availableKeys : Key [ ] ;
0 commit comments