Added code to reset all scroll positions when a route is shown. This way when a route and new data is rendered it's rendered with default scroll positions.
This commit is contained in:
		@@ -57,6 +57,17 @@ IgniteTemplate.prototype.route = function (routes, showCallback = null, hideCall
 | 
				
			|||||||
            //Show the route element.
 | 
					            //Show the route element.
 | 
				
			||||||
            this.element.style.removeProperty("display");
 | 
					            this.element.style.removeProperty("display");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //Reset scroll bars for route
 | 
				
			||||||
 | 
					            this.element.scrollTop = 0;
 | 
				
			||||||
 | 
					            this.element.scrollLeft = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //Reset scroll bars for all elements inside route
 | 
				
			||||||
 | 
					            [...this.element.querySelectorAll("*")].forEach(element => {
 | 
				
			||||||
 | 
					                element.scrollTop = 0;
 | 
				
			||||||
 | 
					                element.scrollLeft = 0;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //Invoke show callback if any.
 | 
				
			||||||
            if (showCallback) {
 | 
					            if (showCallback) {
 | 
				
			||||||
                showCallback(matchedRoute, (event && event.data ? event.data : data), back);
 | 
					                showCallback(matchedRoute, (event && event.data ? event.data : data), back);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user