-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat: StepFormDialogコンポーネントの作成 #5004
base: master
Are you sure you want to change the base?
Conversation
commit: |
packages/smarthr-ui/src/components/Dialog/StepFormDialog/useStep.tsx
Outdated
Show resolved
Hide resolved
packages/smarthr-ui/src/components/Dialog/StepFormDialog/useStep.tsx
Outdated
Show resolved
Hide resolved
packages/smarthr-ui/src/components/Dialog/StepFormDialog/StepFormDialogContentInner.tsx
Outdated
Show resolved
Hide resolved
packages/smarthr-ui/src/components/Dialog/StepFormDialog/StepFormDialog.tsx
Show resolved
Hide resolved
b3e6672
to
3184105
Compare
ae6eb2c
to
f04ee15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
次へボタンの追加など以外はほとんど FormDialog と同じ構成になってます
await act(() => userEvent.click(screen.getByRole('button', { name: '戻る' }))) | ||
expect(screen.getByRole('dialog', { name: 'StepFormDialog 1/2' })).toBeVisible() | ||
|
||
await act(() => userEvent.click(screen.getByRole('button', { name: '次へ' }))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HELP
今は通っているんですが、この次へを押した次に 2/2 ステップ目かの assertion を入れるとCI上でだけ落ちる事件が発生していました。。。原因わからずです
if (!props.isOpen) { | ||
return undefined | ||
} | ||
focusTrapRef.current?.focus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここでは FormDialog.tsx とほぼ構成を変えず、この focusTrap の操作を追加しています!
const actionText = | ||
activeStep === stepLength | ||
? submitLabel | ||
: decorators?.nextButtonLabel?.(NEXT_BUTTON_LABEL) || NEXT_BUTTON_LABEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FormDialog では actionLabel
はpropsで必須で、それ以外は decorators で変更という方針でした!
基本 次へ
ボタンのラベルのバリエーションを増やすことは無いと考え、次へは decorators で渡すという方法にしています!
{/* eslint-disable-next-line smarthr/best-practice-for-layouts */} | ||
<Stack gap={0} className={wrapper()}> | ||
<DialogHeader | ||
title={`${title} ${activeStep}/${stepLength}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
単純な興味なんですが、このあたり読み上げ問題なさそうですか?分数が今どうなってたか追えておらず… 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
日本語としての読み上げなら「◯ぶんの◯」となるのが一番いいところなんですが、「◯スラッシュ◯」となるのは一般的な記述かつ文脈的に判断できるところなので今回はこれで問題なしとしてますー!
freeeさんもこんなQnAを出してましたー! スラッシュ(/)を含む数字はどのように読み上げられるべきか — freeeアクセシビリティー・ガイドライン Ver. 202411.0-RELEASE+5.1.0
関連URL
https://app.asana.com/0/1206535203416259/1208178713972396/f
※ アクセシビリティ本部のAsanaです!
概要
StepFormDialog の実装をしました。
目的
使用イメージ
変更内容
確認方法