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

Fix: Stepper reset handler #381

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

PruthviPraj00
Copy link
Contributor

@PruthviPraj00 PruthviPraj00 commented Jun 2, 2024

Hello @olegpix,

Problem

I encounter an issue with the stepper component. When the reset button is clicked, other elements like navigation and buttons reset correctly, but the content of the final step is still displayed, as shown in the image below.

Preline Documentation image
Screenshot 2024-06-02 183039

It appears that the issue is caused by the placement of the following code:

//  handleResetButtonClick()
this.setCurrentNavItem();
this.setCurrentContentItem();
this.showFinishButton();
this.showCompleteStepButton();
this.checkForTheFirstStep();

// This code
this.unsetCompleted();
this.isCompleted = false;

Solution

The problem is resolved by placing the following code above the other function calls:

this.unsetCompleted();
this.isCompleted = false;

this.setCurrentNavItem();
this.setCurrentContentItem();
this.showFinishButton();
this.showCompleteStepButton();
this.checkForTheFirstStep();

Moving this.unsetCompleted(); and this.isCompleted = false; above the other function calls ensures that the content resets properly along with the navigation and buttons.

Solved image

solved.mp4

@PruthviPraj00 PruthviPraj00 changed the title Fix: reset handler Fix: Stepper reset handler Jun 3, 2024
@VictorVSa
Copy link

This seems to be easy to review, could this get merged soon?

@olegpix olegpix merged commit 055e666 into htmlstreamofficial:main Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants