Skip to content

Commit b46b127

Browse files
committed
Changed label indication rendering
1 parent dcc8915 commit b46b127

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/incubator/TextField/Label.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Label = ({
2828
const style = useMemo(() => {
2929
return [styles.label, labelStyle, floatingPlaceholder && styles.dummyPlaceholder];
3030
}, [labelStyle, floatingPlaceholder]);
31+
const shouldRenderIdication = context.isMandatory && showMandatoryIndication;
3132

3233
if ((label || floatingPlaceholder) && !forceHidingLabel) {
3334
return (
@@ -38,8 +39,7 @@ const Label = ({
3839
recorderTag={'unmask'}
3940
{...labelProps}
4041
>
41-
{label}
42-
{context.isMandatory && showMandatoryIndication && '*'}
42+
{shouldRenderIdication ? label?.concat('*') : label}
4343
</Text>
4444
);
4545
}

0 commit comments

Comments
 (0)