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

advanceOn blur? #89

Closed
jjwilliams opened this issue Dec 23, 2015 · 5 comments
Closed

advanceOn blur? #89

jjwilliams opened this issue Dec 23, 2015 · 5 comments
Labels

Comments

@jjwilliams
Copy link

Is this not supported? Simple step:

tour.addStep('title', {
                text: 'Enter the title',
                title: 'Title',
                attachTo: '#Title top',
                advanceOn: {
                    selector: '#Title',
                    event: 'blur'
                },
                buttons: [
                    {
                        text: 'Prev',
                        action: tour.back
                    },
                    {
                        text: 'Next',
                        action: tour.next
                    },

                    {
                        text: 'End',
                        action: tour.cancel
                    }
                ]
            });

If I use click it works fine, but not blur. Any ideas why? Is this not supported?

@jjwilliams
Copy link
Author

Anyone?

@geoffdaigle
Copy link
Contributor

Hi @jjwilliams, really sorry for the massive delay in response. I'm combing through these issues now that I have publish access.

Looks like that would work https://github.com/HubSpot/shepherd/blob/master/src/js/shepherd.js#L212-L217 because the event is being bound to document.body (which assumes event bubbling) using addEventListener.

Are you able to get it working in any other contexts or a blank project? Is #Title a form element that can be blurred?

@mattdh666
Copy link

It works for me (in modern browsers), if I set the useCapture parameter to true in the call to addEventListener().

document.body.addEventListener(event, handler, true);

https://github.com/HubSpot/shepherd/blob/master/src/js/shepherd.js#L213

@RobbieTheWagner
Copy link
Member

Does anyone know of a fix for this?

@chuckcarpenter
Copy link
Member

validated and PR: #233

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

5 participants