-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FE] 리뷰 작성 페이지에서 동적으로 에러가 생기는 경우, 해당 에러를 읽어주는 기능 #891
Merged
ImxYJL
merged 9 commits into
develop
from
fe/feat/890-read-review-writing-error-message
Oct 22, 2024
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bdb960e
feat: Checkbox 선택 여부를 스크린 리더 사용자에게 안내하는 기능 추가
ImxYJL 633f65b
feat: 탭 접근성 강화
ImxYJL 0710167
feat: 에러 메세지가 등장하는 경우 해당 에러 메세지 컴포넌트에 포커스를 주는 훅 작성
ImxYJL 832ef12
feat: useFocusMessage 훅 적용
ImxYJL 6bdb641
feat: CheckboxItem을 전체 선택했을 때도 선택 여부를 알려주도록 변경
ImxYJL 095ec22
refactor: handleKeyDown 이벤트 핸들러에서 사용하는 ChangeEvent 타입 캐스팅을 partial을 사…
ImxYJL 304b4f5
Merge branch 'fe/feat/870-checkbox-accessibility' of https://github.c…
ImxYJL 09ad1c7
refactor: 업데이트된 sr-only 스타일 반영
ImxYJL 8820c8a
Merge branch 'develop' of https://github.com/woowacourse-teams/2024-r…
ImxYJL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
frontend/src/pages/ReviewWritingPage/form/hooks/useFocusMessage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useRef, useEffect } from 'react'; | ||
|
||
interface useMessageFocusProps { | ||
isMessageShown: boolean; | ||
} | ||
|
||
const useFocusMessage = <T extends HTMLElement = HTMLElement>({ isMessageShown }: useMessageFocusProps) => { | ||
const messageRef = useRef<T | null>(null); | ||
|
||
useEffect(() => { | ||
if (isMessageShown && messageRef.current) { | ||
messageRef.current.focus(); | ||
} | ||
}, [isMessageShown]); | ||
|
||
return { | ||
messageRef, | ||
}; | ||
}; | ||
|
||
export default useFocusMessage; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
이모지는 읽어주지 않는게 좋을 것 같아요. 이모지를 이미지로 빼서, alt ="" 로 하는 것 추천합니다.