Skip to content

Commit

Permalink
fixes z-index, removes duplicated modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ozziexsh committed May 27, 2022
1 parent 9cfc2b9 commit 957591e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
5 changes: 3 additions & 2 deletions src/stubs/resources/js/Jetstream/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function JetDropdown({
className="fixed inset-0 z-40"
style={{ display: open ? 'block' : 'none' }}
onClick={() => setOpen(false)}
></div>
/>

<Transition
show={open}
Expand All @@ -51,10 +51,11 @@ export default function JetDropdown({
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
className={'relative z-50'}
>
<div
className={classNames(
'absolute z-50 mt-2 rounded-md shadow-lg',
'absolute mt-2 rounded-md shadow-lg',
widthClass,
alignmentClasses,
)}
Expand Down
43 changes: 0 additions & 43 deletions src/stubs/resources/js/Jetstream/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,47 +79,4 @@ export default function JetModal({
</Transition.Root>,
document.body,
);

return ReactDOM.createPortal(
<Transition show={isOpen} leave="duration-200">
<div className="fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50">
<Transition
show={isOpen}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div
className="fixed inset-0 transform transition-all"
onClick={onClose}
>
<div className="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
</Transition>

<Transition
show={isOpen}
enter="ease-out duration-300"
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
enterTo="opacity-100 translate-y-0 sm:scale-100"
leave="ease-in duration-200"
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<div
className={classNames(
'mb-6 bg-white rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto',
maxWidthClass,
)}
>
{children}
</div>
</Transition>
</div>
</Transition>,
document.body,
);
}

0 comments on commit 957591e

Please sign in to comment.