Scroll to the top after saving
[MAILPOET-2677]
This commit is contained in:
committed by
Veljko V
parent
4ea653b81f
commit
918fb4bd87
@@ -14,8 +14,8 @@ export default () => {
|
|||||||
const showSuccess = notices.success;
|
const showSuccess = notices.success;
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (clicked && !isSaving) {
|
if (clicked && !isSaving) {
|
||||||
if (error) showError(error.map((err) => <p>{err}</p>));
|
if (error) showError(error.map((err) => <p>{err}</p>), { scroll: true });
|
||||||
else showSuccess(<p>{MailPoet.I18n.t('settingsSaved')}</p>);
|
else showSuccess(<p>{MailPoet.I18n.t('settingsSaved')}</p>, { scroll: true });
|
||||||
}
|
}
|
||||||
}, [clicked, error, isSaving, showError, showSuccess]);
|
}, [clicked, error, isSaving, showError, showSuccess]);
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
|
Reference in New Issue
Block a user