-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Add skip event listener #57
base: master
Are you sure you want to change the base?
Add skip event listener #57
Conversation
Thanks for the PR. It looks good, however, I think it'd be better if we keep it firing |
@mohebifar thanks for the feedback. Could you please explain me your idea? |
Let me know what you think |
@mohebifar eventEmitter.addEventListener('stop', ({ wasSkipped, skippedStep, nextStep }) => {
if (skippedStep) {
// was skipped at step: `skippedStep`
}
}) and because i only have the skippedStep and nextStep if the eventEmitter.addEventListener('stop', ({ skippedStep, nextStep }) => {
if (skippedStep) {
// was skipped at step: `skippedStep`
}
}) What you think about it? |
That sounds good! But I'd say let's keep Would like to do that? If so, feel free to update this PR, otherwise, we can close it and I'll try to implement it later. |
f91d892
to
7f7ca95
Compare
7f7ca95
to
08d0017
Compare
Hi @mohebifar I'm happy to do it. |
@mohebifar Can you review this again, please? |
Where is |
File src/components/CopilotModal.js line 215.
|
I tested your branch and it doesn't seem to pass wasSkipped correctly until you change the skip button's code in {
!isLastStep ?
<TouchableOpacity onPress={() => handleStop(true)}>
<Button>Skip</Button>
</TouchableOpacity>
: null
} Couldn't we just use handleStop = (wasSkipped?: boolean) => {
const wasSkipped = !this.props.isLastStep;
this.reset();
this.props.stop(wasSkipped);
} |
Hi, But the problem with the @mohebifar solution:
is we can't put a skip button on the last step. I know this is weird to put a skip button on the last step but for example, it can be useful if you want to use the "skip" button for another behavior than simply stoping the walkthrough. Thank's |
No description provided.