@@ -10,7 +10,7 @@ import devWarning from '../../vc-util/devWarning';
10
10
import useMergedState from '../../_util/hooks/useMergedState' ;
11
11
import useState from '../../_util/hooks/useState' ;
12
12
import type { Ref } from 'vue' ;
13
- import { computed , shallowRef , watchEffect } from 'vue' ;
13
+ import { computed , shallowRef } from 'vue' ;
14
14
import type { CheckboxProps } from '../../checkbox' ;
15
15
import Checkbox from '../../checkbox' ;
16
16
import Dropdown from '../../dropdown' ;
@@ -167,12 +167,14 @@ export default function useSelection<RecordType>(
167
167
// Save last selected key to enable range selection
168
168
const [ lastSelectedKey , setLastSelectedKey ] = useState < Key | null > ( null ) ;
169
169
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
+ // });
176
178
177
179
const setSelectedKeys = ( keys : Key [ ] ) => {
178
180
let availableKeys : Key [ ] ;
0 commit comments