Skip to content

Commit b00435c

Browse files
authored
Fiddle: small correction for checkbox (#222)
1 parent 722897e commit b00435c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/atoms/checkbox/component.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ const StyledHiddenCheckbox = styled.input`
122122
clip: rect(0 0 0 0);
123123
clippath: inset(50%);
124124
height: 1px;
125+
width: 1px;
125126
margin: -1px;
126127
overflow: hidden;
127128
padding: 0;
128129
position: absolute;
129130
white-space: nowrap;
130-
width: 1px;
131131
`;
132132

133133
const StyledCheckbox = styled.div`
@@ -138,6 +138,12 @@ const StyledCheckbox = styled.div`
138138
height: 1em;
139139
`;
140140

141+
const StyledText = styled.span`
142+
cursor: pointer;
143+
flex-basis: 0;
144+
flex-grow: 1;
145+
`;
146+
141147
interface ICheckBoxProps extends IComponentProps<ICheckboxTheme> {
142148
text: string;
143149
isChecked: boolean;
@@ -178,7 +184,7 @@ export function Checkbox({
178184
)}
179185
</StyledCheckbox>
180186
<Spacing variant={props.gutter || PaddingSize.Default} />
181-
{ props.text }
187+
<StyledText>{ props.text }</StyledText>
182188
</StyledContainer>
183189
);
184190
}

0 commit comments

Comments
 (0)