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

Don't set target element for steps unless it is found #29

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

arnaudbroes
Copy link
Contributor

This is a PR that serves as a workaround/fix for #12.

Right now it is possible to navigate to a different view or render an element before the next step is loaded via the onBeforeStepChange event. However, when a new element is rendered, it cannot be targeted even if refresh() or updatePositions(). This happens because the target element is undefined (because it does not exist yet) when the steps are initially computed, and recomputing them through a refresh does not work because the target is replaced by the undefined value on the first compute.

By simply not setting the target if the element cannot be found during compute, this can be avoided and new elements can easily be targeted after calling refresh().

Copy link
Owner

@sjmc11 sjmc11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@sjmc11 sjmc11 merged commit 314d679 into sjmc11:main Mar 5, 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.

None yet

2 participants