-
Notifications
You must be signed in to change notification settings - Fork 6
feat(Button): 버튼 컴포넌트의 최소 WAI-ARIA 기본 접근성 개선(#215) #244
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
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,6 +29,7 @@ export const Button = forwardRef(function Button( | |||||
| { | ||||||
| variant = ButtonVariant.filled, | ||||||
| size = ButtonSize.lg, | ||||||
| type = 'button', | ||||||
| asChild, | ||||||
| disabled, | ||||||
| className: _className, | ||||||
|
|
@@ -39,5 +40,5 @@ export const Button = forwardRef(function Button( | |||||
| const Comp = asChild ? Slot : 'button'; | ||||||
| const className = cx(styles.button({ variant, size }), { [styles.disabled]: disabled }, _className); | ||||||
|
|
||||||
| return <Comp ref={ref} className={className} disabled={disabled} {...props} />; | ||||||
|
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.
Suggested change
Member
Author
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. @minji0214 좋은 의견 감사합니다!! 다만 현재 코드에서 type은 명시적으로 설정하지 않고 ...props에 포함되어, 직접 전달하지 않는 한 문제가 발생하지 않습니다!! 또한 Radix UI의 Slot 패턴에서는 props 위임이 의도된 동작이고, type만 필터링하면 disabled 등 다른 button-specific 속성도 같은 문제를 갖게 될 것 같습니다! props 필터링이 필요하다면 전체적으로 접근해야 할 것 같아, 현재 Radix 컨벤션을 따르는 것이 적절하다고 생각했숩니다,,! 혹시 요 의견에 대해서는 어떻게 생각하시는지 궁금합니다! 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. 그렇네용 다른 컴포넌트들의 소스를 보니 동일하게 props를 전달하고 있네요, radix의 기본 설계를 따르는게 맞을거 같습니다! @osohyun0224 |
||||||
| return <Comp ref={ref} type={type} className={className} disabled={disabled} {...props} />; | ||||||
| }); | ||||||
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.
@osohyun0224
허걱쓰 default submit 이였다니 ㅎㅎ..