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

WIP: test: StepFormDialog 落ちているテストだけ別PRに分けた #5368

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d6b335a
feat: FocusTrap を任意のタイミングで focus できるように ref のフォワーディング追加
schktjm Oct 2, 2024
3e86842
feat: DialogContentInner へ focusTrap の props を追加
schktjm Oct 11, 2024
d6e7b52
feat: StepActionDialog の作成
schktjm Oct 11, 2024
c6d5be7
feat: FormDialog 用storybookの作成
schktjm Oct 11, 2024
b3b7214
refactor: FormDialog と別概念なため story の名称変更
schktjm Oct 15, 2024
3324227
fix: remoteTrigger 用コンポーネントは必須ではないため作らない
schktjm Oct 15, 2024
2ce4e28
feat: 利用側で渡した関数を実行するようにした
schktjm Oct 15, 2024
9c3ff74
refactor: クラス名追加と実装順の変更
schktjm Oct 15, 2024
e316984
feat: index ファイルにコンポーネントを追加
schktjm Oct 15, 2024
6f2821c
feat: Stepを飛ばせるようにidで管理する
schktjm Dec 19, 2024
d197767
feat: storybookのスタイルを整える
schktjm Dec 19, 2024
1cae2e6
feat: 修正
schktjm Dec 19, 2024
fc6c224
fix: 戻る機能の修正
schktjm Dec 23, 2024
10f967f
feat: StepFormDialogのテストの実装
schktjm Dec 23, 2024
af9a575
fix: test
schktjm Dec 23, 2024
88b11bd
fix: test
schktjm Dec 23, 2024
f7b5a51
fix: 問題の箇所にasync/awaitをつけてみる
schktjm Dec 23, 2024
47f06f7
fix: test
schktjm Dec 23, 2024
617274c
fix: test
schktjm Dec 23, 2024
178b892
fix: assertion消したら動くのか
schktjm Dec 23, 2024
5adf79a
chore: styled -> tv
schktjm Jan 23, 2025
8209550
Update packages/smarthr-ui/src/components/Dialog/StepFormDialog/StepF…
schktjm Jan 23, 2025
f39ae48
refactor: 再レンダリングを防ぐ必要がなかったためContextを一つに
schktjm Jan 23, 2025
e36f85b
chore: fix ci
schktjm Jan 23, 2025
3168c36
Merge branch 'master' of github.com:kufu/smarthr-ui into feat/step-di…
schktjm Feb 6, 2025
1cbea82
fix: userEvent -> fireEvent
schktjm Feb 6, 2025
d712b2e
fix: decoratorインポート先を変更
schktjm Feb 6, 2025
8229102
test: CI上で落ちる理由が不明なためテストを一旦削除
schktjm Feb 6, 2025
f286778
feat: 落ちているテストだけ別PRに分けた
schktjm Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: DialogContentInner へ focusTrap の props を追加
  • Loading branch information
schktjm committed Jan 23, 2025
commit 3e86842d13e9e21eea9cffb095cac4e92fac76bf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { tv } from 'tailwind-variants'
import { useHandleEscape } from '../../hooks/useHandleEscape'

import { DialogOverlap } from './DialogOverlap'
import { FocusTrap } from './FocusTrap'
import { FocusTrap, FocusTrapRef } from './FocusTrap'
import { useBodyScrollLock } from './useBodyScrollLock'

export type DialogContentInnerProps = PropsWithChildren<{
Expand Down Expand Up @@ -51,6 +51,10 @@ export type DialogContentInnerProps = PropsWithChildren<{
* ダイアログの `aria-labelledby`
*/
ariaLabelledby?: string
/**
* ダイアログトップのフォーカストラップへの ref
*/
focusTrapRef?: RefObject<FocusTrapRef>
}>
type ElementProps = Omit<ComponentProps<'div'>, keyof DialogContentInnerProps>

Expand Down Expand Up @@ -79,6 +83,7 @@ export const DialogContentInner: FC<DialogContentInnerProps & ElementProps> = ({
ariaLabelledby,
children,
className,
focusTrapRef,
...rest
}) => {
const { layoutStyleProps, innerStyle, backgroundStyle } = useMemo(() => {
Expand Down Expand Up @@ -128,7 +133,9 @@ export const DialogContentInner: FC<DialogContentInnerProps & ElementProps> = ({
aria-modal="true"
className={innerStyle}
>
<FocusTrap firstFocusTarget={firstFocusTarget}>{children}</FocusTrap>
<FocusTrap firstFocusTarget={firstFocusTarget} ref={focusTrapRef}>
{children}
</FocusTrap>
</div>
</div>
</DialogOverlap>
Expand Down