-
Notifications
You must be signed in to change notification settings - Fork 49
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
Remove default value of event handler props in Icon
component
#1122
Remove default value of event handler props in Icon
component
#1122
Conversation
🦋 Changeset detectedLatest commit: 10a77f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportBase: 72.77% // Head: 72.75% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## next-v1 #1122 +/- ##
===========================================
- Coverage 72.77% 72.75% -0.02%
===========================================
Files 362 362
Lines 4374 4371 -3
Branches 853 851 -2
===========================================
- Hits 3183 3180 -3
Misses 1117 1117
Partials 74 74
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Chromatic Report🚀 Congratulations! Your build was successful! |
#1079 와 컨플릭이 있겠네용 |
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.
changeset 추가해야겠네요!
8d7dd5a
to
10a77f4
Compare
<!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> Fixes #1122 ## Summary <!-- Please brief explanation of the changes made --> Remove default value of event handler props ## Details <!-- Please elaborate description of the changes --> #1122 를 참고해주세요. ### Breaking change? (Yes/No) <!-- If Yes, please describe the impact and migration path for users --> No
Self Checklist
CODEOWNERS
file.Related Issue
#1123
Summary
Icon
컴포넌트의 이벤트 핸들러 props에 default value를 할당하지 않도록 수정합니다.onClick
onMouseDown
Details
Icon
의onClick
prop에 default value(noop
,() => {}
)가 할당됨으로 인해 문제를 일으키는 경우가 있습니다.아래의 조건을 만족할 경우 a 태그의 telephone number link(
tel:
)가 제대로 동작하지 않습니다.onclick
attribute가 등록된 엘리먼트가 존재할 때예를 들어 아래와 같은 usecase가 있습니다.
Icon
을 활용하여tel:
link로 연결되는 버튼/링크를 만드는 경우 아래와 같은 구조를 가질 수 있습니다.이때, iPad의 Safari 브라우저에서는 해당 링크가 동작하지 않게 됩니다.
target
을_self
,_parent
,_top
등으로 변경해도 동작하지 않습니다.Icon
이 내부적으로 svg 태그에 전달하고 있는onClick
prop을 제거할 경우 정상 동작합니다.--
참고: a 태그 구현의 파편화
각 환경의 브라우저마다 a 태그의 구현이 제각기 다릅니다. 특히, a 태그의
target
attribute에 대해 여러 동작을 가집니다.예를 들어, 아래와 같은 케이스가 존재합니다.
target
이_blank
일 때tel:
link가 동작하지 않습니다. (다른 환경에서는 정상 동작)target
이_self
일 때tel:
link가 동작하지 않습니다. (다른 환경에서는 정상 동작)--
Workaround
아래와 같은 방법으로 Bezier
Icon
컴포넌트의 수정 없이 문제를 해결할 수 있습니다.단, 위와 같은 방법은 실행 환경에 따른 분기 처리를 복잡하게 만들고, iPad의 Safari 브라우저에 a 태그의
tel:
link와 관련된 이슈가 있음을 개발자가 미리 알아채고 대응하기 어렵기 때문에 BezierIcon
의 수정을 통해 문제를 해결하기를 바랍니다.Breaking change or not (Yes/No)
No
References
.