Skip to content

Commit

Permalink
Fix bad reference to root id
Browse files Browse the repository at this point in the history
  • Loading branch information
pwolfert committed Jul 3, 2024
1 parent 119790e commit 83c0a48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const Choice = ({ _choiceChild, ...props }: ChoiceProps) => {
let errorId;
let errorElement;
if (!_choiceChild) {
errorId = props.errorId ?? `${props.id}__error`;
errorId = props.errorId ?? `${id}__error`;
errorElement = (
<InlineError id={errorId} inversed={props.inversed} className={props.errorMessageClassName}>
{props.errorMessage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Choice applies errorMessage to label 1`] = `
class="ds-c-choice-wrapper"
>
<input
aria-describedby="undefined__error"
aria-describedby="choice--11__error"
class="ds-c-choice"
id="choice--11"
name="foo"
Expand All @@ -34,7 +34,7 @@ exports[`Choice applies errorMessage to label 1`] = `
aria-atomic="true"
aria-live="assertive"
class="ds-c-inline-error"
id="undefined__error"
id="choice--11__error"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -76,7 +76,7 @@ exports[`Choice has a hint and requirementLabel 1`] = `
class="ds-c-choice-wrapper"
>
<input
aria-describedby="undefined__error choice--8__hint"
aria-describedby="choice--8__error choice--8__hint"
class="ds-c-choice"
id="choice--8"
name="foo"
Expand All @@ -101,7 +101,7 @@ exports[`Choice has a hint and requirementLabel 1`] = `
aria-atomic="true"
aria-live="assertive"
class="ds-c-inline-error"
id="undefined__error"
id="choice--8__error"
/>
</div>
</div>
Expand All @@ -124,7 +124,7 @@ exports[`Choice is a checkbox 1`] = `
class="ds-c-choice-wrapper"
>
<input
aria-describedby="undefined__error"
aria-describedby="choice--2__error"
class="ds-c-choice"
id="choice--2"
name="foo"
Expand All @@ -143,7 +143,7 @@ exports[`Choice is a checkbox 1`] = `
aria-atomic="true"
aria-live="assertive"
class="ds-c-inline-error"
id="undefined__error"
id="choice--2__error"
/>
</div>
</div>
Expand All @@ -166,7 +166,7 @@ exports[`Choice is a radio 1`] = `
class="ds-c-choice-wrapper"
>
<input
aria-describedby="undefined__error"
aria-describedby="choice--1__error"
class="ds-c-choice"
id="choice--1"
name="foo"
Expand All @@ -185,7 +185,7 @@ exports[`Choice is a radio 1`] = `
aria-atomic="true"
aria-live="assertive"
class="ds-c-inline-error"
id="undefined__error"
id="choice--1__error"
/>
</div>
</div>
Expand All @@ -212,7 +212,7 @@ exports[`Choice nested content renders checked and unchecked children appropriat
class="ds-c-choice-wrapper"
>
<input
aria-describedby="undefined__error"
aria-describedby="choice--23__error"
class="ds-c-choice"
id="choice--23"
name="foo"
Expand All @@ -231,7 +231,7 @@ exports[`Choice nested content renders checked and unchecked children appropriat
aria-atomic="true"
aria-live="assertive"
class="ds-c-inline-error"
id="undefined__error"
id="choice--23__error"
/>
</div>
<strong
Expand Down

0 comments on commit 83c0a48

Please sign in to comment.