Skip to content

Commit

Permalink
Revalidate Modal: Fix issues identified in the initial PR (#321)
Browse files Browse the repository at this point in the history
* Don't let the revalidate modal stetch the login modal wider.

* Don't throw the same click event, throw a recreated object of it, such that it propogates correctly.
  • Loading branch information
dd32 authored Dec 6, 2024
1 parent 835d2de commit 2a4189f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions revalidation/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ window.wp = window.wp || {};
// Finally, notify others.
( theTriggerEvent?.target || window ).dispatchEvent( new Event( 'reValidationComplete', { bubbles: true } ) );

// If the last event was a click, throw that again.
// If the last event was a click, throw that again, but by re-creating it.
if ( theTriggerEvent?.type === 'click' ) {
theTriggerEvent.target.dispatchEvent( theTriggerEvent );
theTriggerEvent.target.dispatchEvent(
new theTriggerEvent.constructor( theTriggerEvent.type, theTriggerEvent )
);
}
};

Expand Down
1 change: 1 addition & 0 deletions revalidation/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dialog.wporg-2fa-revalidate-modal {
border-radius: 8px;
max-width: 500px;
}
dialog.wporg-2fa-revalidate-modal > h1 {
margin: unset;
Expand Down

0 comments on commit 2a4189f

Please sign in to comment.