Skip to content

Commit 8569c5e

Browse files
authoredMar 17, 2022
fix(Transfer): 修复潜在BUG&箭头添加选中效果 (#683)
1 parent c9f444d commit 8569c5e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎packages/react-transfer/src/index.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,13 @@ function Transfer(props: TransferProps) {
139139
leftSelectOption.forEach((value, key) => {
140140
selectOptionTemp.set(key, value);
141141
});
142+
leftSelectOptionSet(selectOptionTemp);
142143
} else {
143144
rightSelectedKeys.forEach((key) => {
144145
selectOption.delete(key!);
145146
});
146147
}
147-
148148
selectOptionSet(selectOptionTemp);
149-
// leftSelectOptionSet(selectOptionTemp);
150149
const option: Array<TransferOptionType> = [];
151150
selectOptionTemp.forEach((label, key) => option.push({ key, label }));
152151
props.onChange?.(transferType, option);
@@ -270,8 +269,14 @@ function Transfer(props: TransferProps) {
270269
</div>
271270
</Card>
272271
<div className={`${prefixCls}-arrow-content`}>
273-
<Arrow click={() => transferClick('left')} style={{ transform: 'rotate(-90deg)' }} />
274-
<Arrow click={() => transferClick('right')} style={{ transform: 'rotate(90deg)' }} />
272+
<Arrow
273+
click={() => transferClick('left')}
274+
style={{ transform: 'rotate(-90deg)', background: leftSelectedKeys.length > 0 ? '#393E48' : 'none' }}
275+
/>
276+
<Arrow
277+
click={() => transferClick('right')}
278+
style={{ transform: 'rotate(90deg)', background: rightSelectedKeys.length > 0 ? '#393E48' : 'none' }}
279+
/>
275280
</div>
276281
<Card
277282
bodyStyle={{ padding: 5 }}

0 commit comments

Comments
 (0)
Please sign in to comment.