Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: aria-describedbyがinputに紐づいている場合もFormControlのaria-describedbyを設定する #5344

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

misako0927
Copy link
Contributor

@misako0927 misako0927 commented Jan 28, 2025

関連URL

概要

conformなどのフォームライブラリを使用している際、FormControlのaria-describedbyが紐づかず、エラー表示時にエラー内容がinput要素で読み取れなくなっていた。

変更内容

input要素にすでにaria-describedbyが設定されている場合も、追加でaria-describedbyを設定するようにした。

確認方法

Storybook等で、FormControl内にあるinput要素にaria-describedbyを手動で設定していた場合も、FormControlのerrorMessagesに指定したエラー内容が読み取れることを確認してください。
例:

<FormControl title="some title" errorMessage={['some error']}>
  <Input aria-describedby="some-id" />
</FormControl>

Copy link

pkg-pr-new bot commented Jan 28, 2025

Open in Stackblitz

npm i https://pkg.pr.new/kufu/smarthr-ui@5344

commit: 9925939

@misako0927 misako0927 changed the title fix: ライブラリなどでaria-describedbyが挿入される場合があるため、input要素にaria-describedbyが紐… fix: aria-describedbyがinputに紐づいている場合もFormControlのaria-describedbyを設定する Jan 28, 2025
@misako0927 misako0927 marked this pull request as ready for review January 28, 2025 23:20
@misako0927 misako0927 requested a review from a team as a code owner January 28, 2025 23:20
@misako0927 misako0927 requested review from Qs-F and masa0527 and removed request for a team January 28, 2025 23:20
Copy link
Member

@AtsushiM AtsushiM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@misako0927 misako0927 merged commit 3c636f1 into master Jan 29, 2025
16 checks passed
@misako0927 misako0927 deleted the append-aria-describedby branch January 29, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants