Skip to content

Commit d11c186

Browse files
authored
fix(form): keep required asterisk from orphaning (#11961)
* fix(form): keep required asterisk from orphaning * chore(form): update tests
1 parent 06af4c5 commit d11c186

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

packages/react-core/src/components/Form/FormGroup.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export const FormGroup: React.FunctionComponent<FormGroupProps> = ({
5656
<span className={css(styles.formLabelText)}>{label}</span>
5757
{isRequired && (
5858
<span className={css(styles.formLabelRequired)} aria-hidden="true">
59-
{' '}
60-
{ASTERISK}
59+
&nbsp;{ASTERISK}
6160
</span>
6261
)}
6362
</LabelComponent>

packages/react-core/src/components/Form/__tests__/__snapshots__/FormGroup.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ exports[`FormGroup should render form group variant with required label 1`] = `
122122
aria-hidden="true"
123123
class="pf-v6-c-form__label-required"
124124
>
125-
*
125+
 *
126126
</span>
127127
</label>
128128
  

packages/react-core/src/components/LoginPage/__tests__/__snapshots__/LoginForm.test.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exports[`LoginForm LoginForm with rememberMeLabel 1`] = `
2525
aria-hidden="true"
2626
class="pf-v6-c-form__label-required"
2727
>
28-
*
28+
 *
2929
</span>
3030
</label>
3131
  
@@ -69,7 +69,7 @@ exports[`LoginForm LoginForm with rememberMeLabel 1`] = `
6969
aria-hidden="true"
7070
class="pf-v6-c-form__label-required"
7171
>
72-
*
72+
 *
7373
</span>
7474
</label>
7575
  
@@ -175,7 +175,7 @@ exports[`LoginForm LoginForm with show password 1`] = `
175175
aria-hidden="true"
176176
class="pf-v6-c-form__label-required"
177177
>
178-
*
178+
 *
179179
</span>
180180
</label>
181181
  
@@ -219,7 +219,7 @@ exports[`LoginForm LoginForm with show password 1`] = `
219219
aria-hidden="true"
220220
class="pf-v6-c-form__label-required"
221221
>
222-
*
222+
 *
223223
</span>
224224
</label>
225225
  
@@ -336,7 +336,7 @@ exports[`LoginForm should render Login form 1`] = `
336336
aria-hidden="true"
337337
class="pf-v6-c-form__label-required"
338338
>
339-
*
339+
 *
340340
</span>
341341
</label>
342342
  
@@ -380,7 +380,7 @@ exports[`LoginForm should render Login form 1`] = `
380380
aria-hidden="true"
381381
class="pf-v6-c-form__label-required"
382382
>
383-
*
383+
 *
384384
</span>
385385
</label>
386386
  

0 commit comments

Comments
 (0)