Skip to content

Commit 4c0282f

Browse files
committed
Add scroll to error notice.
1 parent d9ed9f4 commit 4c0282f

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/js/settings/components/classifai-registration/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ export const SaveSettingsButton = ( {
201201
);
202202
setSettings( res.settings );
203203
setIsSaving( false );
204+
window.scrollTo( {
205+
top: 0,
206+
behavior: 'smooth',
207+
} );
204208
return;
205209
}
206210

@@ -226,6 +230,10 @@ export const SaveSettingsButton = ( {
226230
}
227231
);
228232
setIsSaving( false );
233+
window.scrollTo( {
234+
top: 0,
235+
behavior: 'smooth',
236+
} );
229237
} );
230238
};
231239

src/js/settings/components/feature-settings/save-settings-button.js

+8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export const SaveSettingsButton = ( {
8383
} );
8484
setSettings( res.settings );
8585
setIsSaving( false );
86+
window.scrollTo( {
87+
top: 0,
88+
behavior: 'smooth',
89+
} );
8690
return;
8791
}
8892
onSaveSuccess();
@@ -107,6 +111,10 @@ export const SaveSettingsButton = ( {
107111
}
108112
);
109113
setIsSaving( false );
114+
window.scrollTo( {
115+
top: 0,
116+
behavior: 'smooth',
117+
} );
110118
} );
111119
};
112120

src/js/settings/components/service-settings/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ export const ServiceSettings = () => {
113113
} );
114114
} );
115115
setIsSaving( false );
116+
window.scrollTo( {
117+
top: 0,
118+
behavior: 'smooth',
119+
} );
116120
return;
117121
}
118122

@@ -138,6 +142,10 @@ export const ServiceSettings = () => {
138142
}
139143
);
140144
setIsSaving( false );
145+
window.scrollTo( {
146+
top: 0,
147+
behavior: 'smooth',
148+
} );
141149
} );
142150
};
143151

0 commit comments

Comments
 (0)