Skip to content

Commit

Permalink
Merge pull request #5809 from google/enhancement/#5620-prevent-panel-…
Browse files Browse the repository at this point in the history
…open

Do not open accordion on action click
  • Loading branch information
eugene-manuilov authored Sep 9, 2022
2 parents cdbccec + 5bb824b commit d4d45d7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion assets/js/components/settings/SettingsActiveModule/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export default function Header( { slug } ) {
);
}, [ history, isOpen, slug, viewContext ] );

const onActionClick = useCallback(
( event ) => event.stopPropagation(),
[]
);

if ( ! module ) {
return null;
}
Expand Down Expand Up @@ -155,7 +160,10 @@ export default function Header( { slug } ) {

{ ! connected && (
<Fragment>
<Button href={ adminReauthURL }>
<Button
href={ adminReauthURL }
onClick={ onActionClick }
>
{ sprintf(
/* translators: %s: module name. */
__(
Expand Down

0 comments on commit d4d45d7

Please sign in to comment.