fix: visual editor dialog and password reset flow
1. EmailBuilder: Fixed dialog handlers to not block all interactions - Previously dialog prevented all outside clicks - Now only blocks when WP media modal is open - Dialog can be properly closed via escape or outside click 2. DefaultTemplates: Updated new_customer email - Added note about using 'Forgot Password?' if link expires - Clear instructions for users
This commit is contained in:
@@ -270,28 +270,22 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP
|
||||
{/* Edit Dialog */}
|
||||
<Dialog open={editDialogOpen} onOpenChange={setEditDialogOpen}>
|
||||
<DialogContent
|
||||
className="sm:max-w-2xl"
|
||||
className="sm:max-w-2xl max-h-[90vh] overflow-y-auto"
|
||||
onInteractOutside={(e) => {
|
||||
// Check if WordPress media modal is currently open
|
||||
// Only prevent closing if WordPress media modal is open
|
||||
const wpMediaOpen = document.querySelector('.media-modal');
|
||||
|
||||
if (wpMediaOpen) {
|
||||
// If WP media is open, ALWAYS prevent dialog from closing
|
||||
// regardless of where the click happened
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// If WP media is not open, prevent closing dialog for outside clicks
|
||||
e.preventDefault();
|
||||
// Otherwise, allow the dialog to close normally via outside click
|
||||
}}
|
||||
onEscapeKeyDown={(e) => {
|
||||
// Allow escape to close WP media modal
|
||||
// Only prevent escape if WP media modal is open
|
||||
const wpMediaOpen = document.querySelector('.media-modal');
|
||||
if (wpMediaOpen) {
|
||||
return;
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
// Otherwise, allow escape to close dialog
|
||||
}}
|
||||
>
|
||||
<DialogHeader>
|
||||
|
||||
@@ -201,7 +201,7 @@ Your account is ready. Here\'s what you can do now:
|
||||
|
||||
[button url="{set_password_url}" style="solid"]Set Your Password[/button]
|
||||
|
||||
This link will expire in 24 hours. Once set, you can log in anytime.
|
||||
This link expires in 24 hours. If expired, use "Forgot Password?" on the login page.
|
||||
[/card]
|
||||
|
||||
[button url="{shop_url}" style="outline"]Start Shopping[/button]
|
||||
|
||||
Reference in New Issue
Block a user