We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcc8915 commit b46b127Copy full SHA for b46b127
src/incubator/TextField/Label.tsx
@@ -28,6 +28,7 @@ const Label = ({
28
const style = useMemo(() => {
29
return [styles.label, labelStyle, floatingPlaceholder && styles.dummyPlaceholder];
30
}, [labelStyle, floatingPlaceholder]);
31
+ const shouldRenderIdication = context.isMandatory && showMandatoryIndication;
32
33
if ((label || floatingPlaceholder) && !forceHidingLabel) {
34
return (
@@ -38,8 +39,7 @@ const Label = ({
38
39
recorderTag={'unmask'}
40
{...labelProps}
41
>
- {label}
42
- {context.isMandatory && showMandatoryIndication && '*'}
+ {shouldRenderIdication ? label?.concat('*') : label}
43
</Text>
44
);
45
}
0 commit comments