<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Wizard Issue</title>
	<script id="sap-ui-bootstrap"
		src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
		data-sap-ui-theme="sap_belize"
		data-sap-ui-libs="sap.m"
		data-sap-ui-resourceroots='{"Wizard": "./"}'
		data-sap-ui-async="true">
	</script>
	<script>
		sap.ui.getCore().attachInit(function () {
			sap.ui.require([
				"sap/ui/core/mvc/XMLView"
			], function (XMLView) {
				XMLView.create({viewName: "Wizard.App"}).then(function (oView) {
					oView.placeAt("content");
				});
			});
		});
	</script>
</head>
<body class="sapUiBody" id="content"></body>
</html>
sap.ui.define([
	"sap/ui/core/mvc/Controller"
], function (Controller, EventBus) {
	"use strict";
	return Controller.extend("Wizard.App", {

		onInit : function () {
		  var oEventBus = sap.ui.getCore().getEventBus();
			oEventBus.subscribe('wizard', 'step1Change',
			  this._handleStep1Change, this);
			  
			oEventBus.subscribe('wizard', 'step2Change',
			  this._handleStep2Change, this);
		},
		
		_handleStep1Change() {
		  var oStep1 = this.byId('step1');
		  
		  this.byId('wizard').discardProgress(oStep1);
		  oStep1.setValidated(true);
		},
		
		_handleStep2Change() {
		  var oStep2 = this.byId('step2');
		  
		  this.byId('wizard').discardProgress(oStep2);
		  oStep2.setValidated(true);
		}
		


	});
});
<mvc:View
	controllerName="Wizard.App"
	displayBlock="true"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns:core="sap.ui.core"
	xmlns:tnt="sap.tnt"
	xmlns="sap.m">
	<App id="app">
		<Wizard id="wizard">
		  <WizardStep id="step1" 
		    title="Step 1"
		    nextStep="step2"
		    validated="false">
		    <mvc:XMLView id="step1Content"
          viewName="Wizard.Step1Content" />
		  </WizardStep>
		  <WizardStep id="step2"
		    title="Step 2"
		    nextStep="step3"
		    validated="false">
		    <mvc:XMLView id="step2Content"
          viewName="Wizard.Step2Content" />
		  </WizardStep>
		  <WizardStep id="step3"
		    title="Step 3"
		    validated="false">
		    <mvc:XMLView id="step3Content"
          viewName="Wizard.Step3Content" />
		  </WizardStep>
		</Wizard>
	</App>
</mvc:View>
sap.ui.define([
	"sap/ui/core/mvc/Controller",
], function (Controller) {
	"use strict";
	return Controller.extend("Wizard.Step1Content", {

    onSelectionChange() {
      var oEventBus = sap.ui.getCore().getEventBus();
      oEventBus.publish('wizard', 'step1Change');
    }

	});
});
<mvc:View controllerName="Wizard.Step1Content"
  xmlns:core="sap.ui.core"
  xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m">
  <Title text="Select an item to complete step 1:" />
  <List
    mode="SingleSelectLeft"
    selectionChange=".onSelectionChange"
    includeItemInSelection="true">
    <items>
      <StandardListItem title="Step 1 Item 1" />
      <StandardListItem title="Step 1 Item 2" />
      <StandardListItem title="Step 1 Item 3" />
      <StandardListItem title="Step 1 Item 4" />
      <StandardListItem title="Step 1 Item 5" />
      <StandardListItem title="Step 1 Item 6" />
      <StandardListItem title="Step 1 Item 7" />
      <StandardListItem title="Step 1 Item 8" />
      <StandardListItem title="Step 1 Item 9" />
      <StandardListItem title="Step 1 Item 10" />
      <StandardListItem title="Step 1 Item 11" />
      <StandardListItem title="Step 1 Item 12" />
      <StandardListItem title="Step 1 Item 13" />
      <StandardListItem title="Step 1 Item 14" />
      <StandardListItem title="Step 1 Item 15" />
      <StandardListItem title="Step 1 Item 16" />
      <StandardListItem title="Step 1 Item 17" />
      <StandardListItem title="Step 1 Item 18" />
      <StandardListItem title="Step 1 Item 19" />
      <StandardListItem title="Step 1 Item 20" />
    </items>
  </List>
</mvc:View>
sap.ui.define([
	"sap/ui/core/mvc/Controller",
], function (Controller) {
	"use strict";
	return Controller.extend("Wizard.Step2Content", {
    onInit : function () {
		  var oEventBus = sap.ui.getCore().getEventBus();
			oEventBus.subscribe('wizard', 'step1Change',
			  this._handleStep1Change, this);
		},
		
		_handleStep1Change() {
		  // step 1 selection has changed, so we clear selection of this step 2:
		  this.byId('list').removeSelections(true);
		},
		
    onSelectionChange() {
      var oEventBus = sap.ui.getCore().getEventBus();
      oEventBus.publish('wizard', 'step2Change');
    }

	});
});
<mvc:View controllerName="Wizard.Step2Content"
  xmlns:core="sap.ui.core"
  xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m">
  <Title text="Select an item to complete step 2:" />
  <List id="list"
    mode="SingleSelectLeft"
    selectionChange=".onSelectionChange"
    includeItemInSelection="true">
    <items>
      <StandardListItem title="Step 2 Item 1" />
      <StandardListItem title="Step 2 Item 2" />
      <StandardListItem title="Step 2 Item 3" />
      <StandardListItem title="Step 2 Item 4" />
      <StandardListItem title="Step 2 Item 5" />
      <StandardListItem title="Step 2 Item 6" />
      <StandardListItem title="Step 2 Item 7" />
      <StandardListItem title="Step 2 Item 8" />
      <StandardListItem title="Step 2 Item 9" />
      <StandardListItem title="Step 2 Item 10" />
    </items>
  </List>
</mvc:View>
sap.ui.define([
	"sap/ui/core/mvc/Controller",
], function (Controller) {
	"use strict";
	return Controller.extend("Wizard.Step3Content", {

	});
});
<mvc:View controllerName="Wizard.Step3Content"
  xmlns:core="sap.ui.core"
  xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m">
  <Text text="Move back to step 2 and select a different item and see how the wizard jumps up into the content area of step 1." />
</mvc:View>
# Issue description
In case a `sap.m.Wizard` uses sub-views as content of its wizard steps and
the wizard progress is discarded to a previous but not the first step,
the wizard scroll position jumps up into the content area of its first step. 

# Issue cause
Discarding a wizard step triggers rerendering of the wizard control. 
In doing so, the associated `ScrollEnablement` delegate remembers the current
wizard scroll position by its `onBeforeRendering` method and scrolls back to
this position by its `onAfterRendering` method.

But sub-views are preserved from rerendering and temporary removed from their
original DOM position before `onBeforeRendering` of the `ScrollEnablement` delegate is called.

So the delegate remembers an invalid scroll position of an almost empty wizard
(only wizard step titles are still present) and scrolls back to this invalid position after
rerendering has been completed.