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

타임 픽커 웹 접근성 향상 #458

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ export const TIME_UNIT: { [key: string]: number } = {
hour: 24,
minute: 60,
};

export const TIME_KOREAN: { [key: string]: string } = {
day: '일',
hour: '시간',
minute: '분',
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef } from 'react';

import { TIME_UNIT, TIMEBOX_CHILD_HEIGHT } from './constants';
import { TIME_KOREAN, TIME_UNIT, TIMEBOX_CHILD_HEIGHT } from './constants';
import * as S from './style';

interface TimePickerOptionProps {
Expand Down Expand Up @@ -65,11 +65,19 @@ export default function TimePickerOption({
return (
<S.Container>
<S.PickedTimeOverlay />
<S.TimeBox onScroll={handleScroll} ref={timeBoxRef} onWheel={handleWheel}>
<S.TimeBox
aria-label={`현재 선택된 ${TIME_KOREAN[option]}은 ${currentTime} 입니다. 위, 아래 방향키 혹은 터치로 시간 조절이 가능합니다.`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

오 위아래 방향키로 조작이 가능한가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네 가능하더라구요 ! 🔥🔥🔥

tabIndex={0}
onScroll={handleScroll}
ref={timeBoxRef}
onWheel={handleWheel}
>
<S.Empty />
{Array.from({ length: timeUnit }).map((_, index) => (
<S.Time
key={index}
aria-live="polite"
aria-label={`현재 선택된 ${TIME_KOREAN[option]}은 ${currentTime} 입니다.`}
ref={index === currentTime ? timeBoxChildRef : null}
$isPicked={currentTime === index}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function TimePickerOptionList({ time, setTime }: TimePickerOption
></TimePickerOption>
))}
</S.Container>
<S.PickedTimeText>
<S.PickedTimeText tabIndex={0}>
<p>{day}일</p>
<p>{hour}시</p>
<p>{minute}분</p> 후 마감
Expand Down
Loading