mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 10:39:59 +08:00 
			
		
		
		
	Fixes #6467: ActiveForm will scroll to the nearest visible element when the first error input is hidden
				
					
				
			This commit is contained in:
		| @ -487,7 +487,7 @@ | ||||
|             updateSummary($form, messages); | ||||
|  | ||||
|             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(); | ||||
|                 if (top < wtop || top > wtop + $(window).height) { | ||||
|                     $(window).scrollTop(top); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Qiang Xue
					Qiang Xue