Skip to content

Commit

Permalink
Add scroll to error notice.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Jan 10, 2025
1 parent d9ed9f4 commit 4c0282f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/js/settings/components/classifai-registration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ export const SaveSettingsButton = ( {
);
setSettings( res.settings );
setIsSaving( false );
window.scrollTo( {
top: 0,
behavior: 'smooth',
} );
return;
}

Expand All @@ -226,6 +230,10 @@ export const SaveSettingsButton = ( {
}
);
setIsSaving( false );
window.scrollTo( {
top: 0,
behavior: 'smooth',
} );
} );
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export const SaveSettingsButton = ( {
} );
setSettings( res.settings );
setIsSaving( false );
window.scrollTo( {
top: 0,
behavior: 'smooth',
} );
return;
}
onSaveSuccess();
Expand All @@ -107,6 +111,10 @@ export const SaveSettingsButton = ( {
}
);
setIsSaving( false );
window.scrollTo( {
top: 0,
behavior: 'smooth',
} );
} );
};

Expand Down
8 changes: 8 additions & 0 deletions src/js/settings/components/service-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ export const ServiceSettings = () => {
} );
} );
setIsSaving( false );
window.scrollTo( {
top: 0,
behavior: 'smooth',
} );
return;
}

Expand All @@ -138,6 +142,10 @@ export const ServiceSettings = () => {
}
);
setIsSaving( false );
window.scrollTo( {
top: 0,
behavior: 'smooth',
} );
} );
};

Expand Down

0 comments on commit 4c0282f

Please sign in to comment.