Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step indicator of completion steps has wrong color after entering #213

Closed
madoar opened this issue May 16, 2019 · 5 comments
Closed

Step indicator of completion steps has wrong color after entering #213

madoar opened this issue May 16, 2019 · 5 comments
Labels

Comments

@madoar
Copy link
Owner

madoar commented May 16, 2019

After entering a completion step the corresponding step-indicator in the navigation bar is red instead of dark green:

grafik

Correct would be if the step indicator is dark green like for the other steps.

@madoar madoar added the bug label May 16, 2019
@madoar
Copy link
Owner Author

madoar commented May 16, 2019

The reason for the issue is that the completion step is assigned the css classes current done completed after entering.

This combination is then displayed with:

&.current.done .step-indicator,
&.current.completed .step-indicator {
$wz-param-indicator-state: 'default' !global;
$wz-param-indicator-color: $wz-color-editing !global;
@content;
}

@madoar
Copy link
Owner Author

madoar commented May 16, 2019

A possible quick fix for the issue may be to add an additional constraint to the current css class check. This would change:

public isCurrent(wizardStep: WizardStep): boolean {
return wizardStep.selected;
}

to:

public isCurrent(wizardStep: WizardStep): boolean {
    return wizardStep.selected && !this.wizard.completed;
}

@madoar
Copy link
Owner Author

madoar commented May 23, 2019

At the moment I do not think that the suggested quick-fix is a good solution, because it reduces the possible expressiveness of the CSS by allowing the removal of the selected css class from the navigation bar, while a wizard step is in fact selected.

Another more sophisticated solution may be to use :not(.completed) to specify the condition when to apply certain css in a more detailed way.

@earshinov
Copy link
Contributor

As far as I understand, the problems stems from the fact that completion steps are marked as completed right after they are navigated to by the user. I think the best course of action would be to adjust the condition when the red $wz-color-editing color is applied. Right now it is applied to any steps which happen to be selected and completed at the same time (which is, of course, true for the completion step in the described scenario). Instead, this red color should be applied to the selected step if it was already completed before the user navigated to it. We are going to need an additional .editing CSS class, and perhaps an additional field in the WizardStep class as well. In the result, we will have the following CSS classes for steps:

.optional - for any optional steps

.navigable - for any steps which user could go to using the navigation bar

.done - for any completed steps

.current - for the selected step

.editing - for the selected step, if the user has already completed it before

.completed - added to all steps when the whole wizard is completed

The .current and .editing classes are not mutually exclusive (namely, .editing can only appear on a .selected step), but it seems fine to me. @madoar , what do you think?

@madoar
Copy link
Owner Author

madoar commented Jun 11, 2019

I'm fine with that solution! This will also be more in line with the previous versions of angular-archwizard which also contained an .editing css-class with the same meaning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants