Skip to content

Commit

Permalink
fix: [Modal] fix safe area
Browse files Browse the repository at this point in the history
  • Loading branch information
akai committed Mar 1, 2022
1 parent 62b6863 commit 6beae88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Modal/Base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export const Base: React.FC<ModalProps> = (props) => {

if (!didMount) return null;

const needSafeArea = baseClass === 'Popup' && !actions;

return createPortal(
<div className={clsx(baseClass, className, { active: isShow })} ref={wrapper} tabIndex={-1}>
{backdrop && (
Expand All @@ -91,7 +93,7 @@ export const Base: React.FC<ModalProps> = (props) => {
/>
)}
<div
className={clsx(`${baseClass}-dialog`, { 'pb-safe': !actions })}
className={clsx(`${baseClass}-dialog`, { 'pb-safe': needSafeArea })}
role="dialog"
aria-labelledby={titleId}
aria-modal
Expand Down

0 comments on commit 6beae88

Please sign in to comment.