-
Notifications
You must be signed in to change notification settings - Fork 5
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] 접근성 : 넘버 키패드 스크린리더 개선 #749
Changes from 5 commits
0f57696
ad2d2ea
86113b9
8281b53
7f6a3a8
1cf6116
73bda7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
type Keypad = { | ||
keypad: string; | ||
ariaLabel: string; | ||
}; | ||
|
||
export const amountKeypads: Keypad[] = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. amountKeypads, numberKeypads두 배열이 거의 비슷한 코드라서 반복된다고 느껴질 수 있을 것 같아요. 잠깐 생각해보기론, 기본적으로 1~9까지의 3*3배열과 키패드의 4행(1행이 시작)의 중간에 0이 있는 모습은 똑같으니까요. bottomLeft, bottomRight인자를 받아서 keypads 배열을 반환하는 함수는 어떤가요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 좋아요~~ type마다 다른 키패드를 만들어주는 함수를 만들어서 개선해봤습니당 |
||
{ | ||
keypad: '1', | ||
ariaLabel: '1', | ||
}, | ||
{ | ||
keypad: '2', | ||
ariaLabel: '2', | ||
}, | ||
{ | ||
keypad: '3', | ||
ariaLabel: '3', | ||
}, | ||
{ | ||
keypad: '4', | ||
ariaLabel: '4', | ||
}, | ||
{ | ||
keypad: '5', | ||
ariaLabel: '5', | ||
}, | ||
{ | ||
keypad: '6', | ||
ariaLabel: '6', | ||
}, | ||
{ | ||
keypad: '7', | ||
ariaLabel: '7', | ||
}, | ||
{ | ||
keypad: '8', | ||
ariaLabel: '8', | ||
}, | ||
{ | ||
keypad: '9', | ||
ariaLabel: '9', | ||
}, | ||
{ | ||
keypad: '00', | ||
ariaLabel: '0 2개 버튼', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 우와 좋네요. 이렇게 프로퍼티로 사용하는거! 다만 value, name이라는 이름도 괜찮을 것 같아요. keyPad라고 하면 화면에 출력되는 모습의 내용인건지, 입력했을 때 들어가는 실제 값인건지 헷갈릴 수 있지 않을까해소,,! value, name은 바로 실제 값, 화면 출력 값으로 인지되니까 어떨까 싶었어요. 하지만 이름이 어떠냐는 사실 이 pr의 핵심 기능이 아니라 부차적인 의견이므로 반영은 쿠키가 원하는대로 해주세요용 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keypad가 화면에 보여지는 값, ariaLabel은 스크린 리더가 읽는 값이어서 name이라고 명명하면 조금 의미가 달라질 것 같아요ㅜ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 그렇기도 하겠네요. 좋아요좋아요 👍 |
||
}, | ||
{ | ||
keypad: '0', | ||
ariaLabel: '0', | ||
}, | ||
{ | ||
keypad: '<-', | ||
ariaLabel: '마지막 숫자 지우기', | ||
}, | ||
]; | ||
export const numberKeypads: Keypad[] = [ | ||
{ | ||
keypad: '1', | ||
ariaLabel: '1', | ||
}, | ||
{ | ||
keypad: '2', | ||
ariaLabel: '2', | ||
}, | ||
{ | ||
keypad: '3', | ||
ariaLabel: '3', | ||
}, | ||
{ | ||
keypad: '4', | ||
ariaLabel: '4', | ||
}, | ||
{ | ||
keypad: '5', | ||
ariaLabel: '5', | ||
}, | ||
{ | ||
keypad: '6', | ||
ariaLabel: '6', | ||
}, | ||
{ | ||
keypad: '7', | ||
ariaLabel: '7', | ||
}, | ||
{ | ||
keypad: '8', | ||
ariaLabel: '8', | ||
}, | ||
{ | ||
keypad: '9', | ||
ariaLabel: '9', | ||
}, | ||
{ | ||
keypad: '', | ||
ariaLabel: '', | ||
}, | ||
{ | ||
keypad: '0', | ||
ariaLabel: '0', | ||
}, | ||
{ | ||
keypad: '<-', | ||
ariaLabel: '마지막 숫자 지우기', | ||
}, | ||
]; |
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.
오? html button태그에는 value 속성이 없나보군요...
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.
html button 태그에 value가 있긴 합니다. 하지만 button 태그에 value prop을 넣어주지 않고 Text에 보여주는 역할을 하기 때문에 button prop의 value를 사용하지 않았어요.
Omit을 사용해서 html button의 value를 사용하지 않음을 명시해볼게요
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.
아하 button에서 제공하는 value가 있긴 하지만 이 value가 아니라 직접 커스텀한 value를 사용한다는 의미였군요!! 👍