Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 046cd79

Browse files
committed
Close the 'see who liked' modal when clicked outside
1 parent 2c64a65 commit 046cd79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/modal/ListModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export default function ListModal({
2828
className="fixed inset-0 transition-opacity"
2929
aria-hidden="true"
3030
>
31-
<div className="absolute inset-0 bg-gray-500 opacity-75"></div>
31+
<div
32+
className="absolute inset-0 bg-gray-500 opacity-75"
33+
onClick={() => setIsOpen(false)}
34+
></div>
3235
</Transition>
3336

3437
{/* This element is to trick the browser into centering the modal contents. */}

0 commit comments

Comments
 (0)