fix: fix transfer when trying to select item from the right column while it has "unknown-key" within targetKeys (#48664)

This commit is contained in:
Andrey Krupa 2024-04-26 16:22:24 +03:00 committed by GitHub
parent dfaf6ba0bc
commit cb19e0ed23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -343,7 +343,7 @@ const Transfer = <RecordType extends TransferItem = TransferItem>(
const holder = [...(isLeftDirection ? sourceSelectedKeys : targetSelectedKeys)];
const holderSet = new Set(holder);
const data = [...(isLeftDirection ? leftDataSource : rightDataSource)].filter(
(item) => !item.disabled,
(item) => !item?.disabled,
);
const currentSelectedIndex = data.findIndex((item) => item.key === selectedKey);
// multiple select by hold down the shift key