-
Notifications
You must be signed in to change notification settings - Fork 52
Enhance the Modal component
#1077
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
Enhance the Modal component
#1077
Conversation
🦋 Changeset detectedLatest commit: 17cb0dd 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 |
Chromatic Report🚀 Congratulations! Your build was successful! |
Codecov ReportBase: 72.07% // Head: 72.06% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## next-v1 #1077 +/- ##
===========================================
- Coverage 72.07% 72.06% -0.02%
===========================================
Files 223 223
Lines 3051 3053 +2
Branches 840 840
===========================================
+ Hits 2199 2200 +1
- Misses 728 729 +1
Partials 124 124
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. |
to prevent to show unintended changing of view(state)
1384691 to
c20fb77
Compare
Modal overlay to be scrollableModal component
| closed: css` | ||
| opacity: 0; | ||
| transform: translate(-50%, -48%) scale(0.95); | ||
| transform: translate(0, -2%) scale(0.95); |
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.
애니메이션 사용처에 will-change: transform; 넣어서 유의미한 퍼포먼스 차이가 있는지 체크 해보면 좋겠습니다.
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.
유의미한 퍼포먼스 차이가 없어서, 이른 최적화라고 생각하여 추가하지 않으려고 합니다. (#)
packages/bezier-react/src/components/Modals/Modal/ModalContent.tsx
Outdated
Show resolved
Hide resolved
| <BezierProvider foundation={foundation}> | ||
| <div style={wrapperStyle}> |
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.
| <BezierProvider foundation={foundation}> | |
| <div style={wrapperStyle}> | |
| <div style={wrapperStyle}> |
div 상위의 BezierProvider는 빠져도 될 것 같은데 맞을까요?
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.
두개 테마만 사용되고 있으니 빠져도 괜찮아 보입니다 👀
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.
root에 css variable을 추가하여 오버레이 색상이 잘 표시되도록 합니다.
themeVarsScope 를 제거해서 root에 CSS Variable을 생성하기 위해서 추가한 부분입니다.
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.
(구두 싱크) 이해했습니당
| <BezierProvider foundation={foundation}> | ||
| <div style={wrapperStyle}> |
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.
(구두 싱크) 이해했습니당
Self Checklist
CODEOWNERSfile.Related Issue
없음
Summary
Modal컴포넌트를 애플리케이션에 적용하면서, 부족한 부분들을 개선합니다.Details
오버레이가 스크롤 가능하도록 개선
Modal내부에 Overlay 컴포넌트가 포함될 경우, Portal을 통해 동일하게 rootElement(body) 아래 렌더하는 케이스에서 Overlay 컴포넌트에 클릭이 불가능한 문제가 있었습니다.Modal이modal={true}속성을 가져 외부에 이벤트가 전달되지 않기 때문입니다. 이를 해결하고자 overflow hidden 속성을 제거하고 오버레이 영역 전체가 스크롤 가능하게 변경했습니다. 애플리케이션에서는 Overlay container 속성 지정을 통해Modal내부에 그리는 방식으로 구현하게 됩니다.Modalhide 애니메이션 제거어플리케이션에서
onHide콜백 호출 시, 즉시 특정 상태가 변경되며 UI가 바뀌는 케이스가 있습니다. 애니메이션이 있을 경우 의도치 않은 UI가 애니메이션 실행 시간동안 노출되는 문제가 있어 우선 제거합니다.ModalBody스타일 개선ModalBody가 다른 엘리먼트의 자식이 된 경우에도 스타일링이 잘 적용될 수 있도록 CSS 선택자를 개선합니다.chore: 스토리북 개선
root에 css variable을 추가하여 오버레이 색상이 잘 표시되도록 합니다.
Breaking change or not (Yes/No)
No
References