fix(mobile): cannot change tag color (#11708)

fix AF-2402
This commit is contained in:
pengx17
2025-04-15 13:36:22 +00:00
parent db2a8fd509
commit 220087c172
2 changed files with 13 additions and 3 deletions

View File

@@ -47,6 +47,12 @@ export const mobileTagEditDeleteRow = style({
color: cssVarV2('button/error'), color: cssVarV2('button/error'),
}); });
export const mobileTagEditTrigger = style({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
});
export const spacer = style({ export const spacer = style({
flex: 1, flex: 1,
}); });

View File

@@ -131,8 +131,10 @@ const MobileTagEditMenu = ({
const [localTag, setLocalTag] = useState({ ...tag }); const [localTag, setLocalTag] = useState({ ...tag });
useEffect(() => { useEffect(() => {
setLocalTag({ ...tag }); if (localTag.value !== tag.value) {
}, [tag]); setLocalTag({ ...tag });
}
}, [tag, localTag.value]);
const handleTriggerClick: MouseEventHandler<HTMLDivElement> = useCallback( const handleTriggerClick: MouseEventHandler<HTMLDivElement> = useCallback(
e => { e => {
@@ -210,7 +212,9 @@ const MobileTagEditMenu = ({
</ConfigModal.Row> </ConfigModal.Row>
</ConfigModal.RowGroup> </ConfigModal.RowGroup>
</ConfigModal> </ConfigModal>
<div onClick={handleTriggerClick}>{children}</div> <div onClick={handleTriggerClick} className={styles.mobileTagEditTrigger}>
{children}
</div>
</> </>
); );
}; };