Skip to content
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

fix: prevent parent drawers from closing when canceling nested drawers #1748

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/web/ui/modals/accept-invite-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ function AcceptInviteModal({
<div className="flex flex-col space-y-6 bg-gray-50 px-4 py-8 text-left sm:px-16">
<Button
text="Back to dashboard"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
router.push("/");
setShowAcceptInviteModal(false);
}}
Expand Down
5 changes: 4 additions & 1 deletion apps/web/ui/modals/add-bank-account-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ const AddBankAccountForm = ({ closeModal }: AddBankAccountFormProps) => {
text="Cancel"
className="h-9 w-fit"
disabled={isSubmitting || isExecuting}
onClick={closeModal}
onClick={(e) => {
e.stopPropagation();
closeModal();
}}
/>

<Button
Expand Down
5 changes: 4 additions & 1 deletion apps/web/ui/modals/deposit-funds-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ const DepositFundsForm = ({ closeModal }: { closeModal: () => void }) => {
text="Cancel"
className="h-9 w-fit"
disabled={isSubmitting || isExecuting}
onClick={closeModal}
onClick={(e) => {
e.stopPropagation();
closeModal();
}}
/>

<Button
Expand Down
8 changes: 6 additions & 2 deletions apps/web/ui/modals/link-builder/advanced-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ function AdvancedModal({
<button
type="button"
className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
setValueParent("externalId", null, { shouldDirty: true });
setValueParent("identifier", null, { shouldDirty: true });
setShowAdvancedModal(false);
Expand All @@ -192,7 +193,10 @@ function AdvancedModal({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => setShowAdvancedModal(false)}
onClick={(e) => {
e.stopPropagation();
setShowAdvancedModal(false);
}}
/>
<Button
type="submit"
Expand Down
6 changes: 4 additions & 2 deletions apps/web/ui/modals/link-builder/expiration-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ function ExpirationModal({
<button
type="button"
className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
setValueParent("expiresAt", null, { shouldDirty: true });
setValueParent("expiredUrl", null, { shouldDirty: true });
setShowExpirationModal(false);
Expand All @@ -247,7 +248,8 @@ function ExpirationModal({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
reset();
setShowExpirationModal(false);
}}
Expand Down
6 changes: 4 additions & 2 deletions apps/web/ui/modals/link-builder/og-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ function OGModalInner({
<button
type="button"
className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
setValueParent("proxy", false, { shouldDirty: true });
setShowOGModal(false);
}}
Expand All @@ -451,7 +452,8 @@ function OGModalInner({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
reset();
setShowOGModal(false);
}}
Expand Down
6 changes: 4 additions & 2 deletions apps/web/ui/modals/link-builder/password-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ function PasswordModalInner({
<button
type="button"
className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
setValueParent("password", null, { shouldDirty: true });
setShowPasswordModal(false);
}}
Expand All @@ -191,7 +192,8 @@ function PasswordModalInner({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
reset();
setShowPasswordModal(false);
}}
Expand Down
6 changes: 4 additions & 2 deletions apps/web/ui/modals/link-builder/targeting-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ function TargetingModal({
<button
type="button"
className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
setValueParent("ios", null, { shouldDirty: true });
setValueParent("android", null, { shouldDirty: true });
setValueParent("geo", null, { shouldDirty: true });
Expand All @@ -382,7 +383,8 @@ function TargetingModal({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
reset();
setShowTargetingModal(false);
}}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/ui/modals/link-builder/utm-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ function UTMModalInner({ setShowUTMModal }: UTMModalProps) {
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
reset();
setShowUTMModal(false);
}}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/ui/modals/link-qr-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ function LinkQRModalInner({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
onClick={() => {
onClick={(e) => {
e.stopPropagation();
setShowLinkQRModal(false);
}}
/>
Expand Down