MCPcopy Create free account
hub / github.com/UI5/webcomponents / switchSelectionFromOldToNewStep

Method switchSelectionFromOldToNewStep

packages/fiori/src/Wizard.ts:1011–1027  ·  view source on GitHub ↗

* Switches the selection from the old step to the newly selected step. * @param selectedStep the old step * @param stepToSelect the step to be selected * @param stepToSelectIndex the index of the newly selected step * @param withScroll the selection changed due to user scrolling * @private

(selectedStep: WizardStep | null, stepToSelect: WizardStep, stepToSelectIndex: number, withScroll: boolean)

Source from the content-addressed store, hash-verified

1009 * @private
1010 */
1011 switchSelectionFromOldToNewStep(selectedStep: WizardStep | null, stepToSelect: WizardStep, stepToSelectIndex: number, withScroll: boolean) {
1012 if (selectedStep && stepToSelect) {
1013 // keep the selection if next step is disabled
1014 if (!stepToSelect.disabled) {
1015 selectedStep.selected = false;
1016 stepToSelect.selected = true;
1017 }
1018
1019 this.fireDecoratorEvent("step-change", {
1020 step: stepToSelect,
1021 previousStep: selectedStep,
1022 withScroll,
1023 });
1024
1025 this.selectedStepIndex = stepToSelectIndex;
1026 }
1027 }
1028
1029 /**
1030 * Sorter method for sorting an array in ascending order.

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected