mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Fixes #6467: ActiveForm will scroll to the nearest visible element when the first error input is hidden
This commit is contained in:
@ -5,6 +5,7 @@ Yii Framework 2 Change Log
|
|||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
- Bug #6404: advanced application template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller)
|
- Bug #6404: advanced application template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller)
|
||||||
|
- Enh #6467: `ActiveForm` will scroll to the nearest visible element when the first error input is hidden (newartix)
|
||||||
|
|
||||||
|
|
||||||
2.0.1 December 07, 2014
|
2.0.1 December 07, 2014
|
||||||
|
|||||||
@ -487,7 +487,7 @@
|
|||||||
updateSummary($form, messages);
|
updateSummary($form, messages);
|
||||||
|
|
||||||
if (errorInputs.length) {
|
if (errorInputs.length) {
|
||||||
var top = $form.find(errorInputs.join(',')).first().offset().top;
|
var top = $form.find(errorInputs.join(',')).first().closest(':visible').offset().top;
|
||||||
var wtop = $(window).scrollTop();
|
var wtop = $(window).scrollTop();
|
||||||
if (top < wtop || top > wtop + $(window).height) {
|
if (top < wtop || top > wtop + $(window).height) {
|
||||||
$(window).scrollTop(top);
|
$(window).scrollTop(top);
|
||||||
|
|||||||
Reference in New Issue
Block a user