Skip to content

Conversation

@yamanoku
Copy link
Contributor

こんにちは。本日開催されていた焼肉争奪戦!NU CAMP Dev&Pub LT Party を観覧枠で聴いていたものです。
星の点数読み上げ対応をされていると聴いたときは、素晴らしい対応だなと思いました。

ソースコードの方拝見させていただいて、アクセシビリティ観点での補強として出させて頂きました。
完全に IMO (個人的な意見)なプルリクエストになりますが、もしよければ見ていただければと思います 🙏🏼

return (
<Card>
{heading}
<div role="img" aria-label={`星 5 つ中 ${integerScore} `}>
Copy link
Contributor Author

@yamanoku yamanoku May 16, 2021

Choose a reason for hiding this comment

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

星 5 つ中というラベルであった時、VoiceOver の日本語読み上げだと
「ほしごつなか」と読み上げてしまうので、f9238f6 (#221) にて丁寧な言葉に対応しました。

hashtags={['ダジャレ判定']}
className="px-4 py-2 bg-twitter text-white rounded-sm"
resetButtonStyle={false}
aria-label="結果をツイート"
Copy link
Contributor Author

@yamanoku yamanoku May 16, 2021

Choose a reason for hiding this comment

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

<button> の中の結果をツイート文言とダブってしまうのですが、
<TwitterShareButton> では aria-label="twitter" がデフォルトになっているため
読み上げ時に何のボタンなのかが分からなくなるため、上書きする意味で変更しました。

Comment on lines +48 to +50
<label htmlFor="input-dajare" className="sr-only">
ダジャレ入力欄
</label>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

<input> タグにはそれに紐づく <label> が必要なため
.sr-only で見た目上見えないようにして関連付けました。
https://tailwindcss.com/docs/screen-readers

Copy link
Member

@ygkn ygkn left a comment

Choose a reason for hiding this comment

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

まさか PR まで出してくださるとは……!

助かります。ありがとうございます!!!

@ygkn ygkn merged commit dfc82aa into rits-dajare:main May 16, 2021
@yamanoku yamanoku deleted the fix-imo-a11y branch June 20, 2021 00:24
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