question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"prev" and "next" navigation buttons have click conflict to/from first survey page

See original GitHub issue

Are you requesting a feature, reporting a bug or ask a question?

Reporting a bug

What is the current behavior?

When navigating back to the first page of a survey with the “prev” button, a click seems to register with both “prev” and “next” buttons. That, or a similar conflict is occurring (the plnkr and GIF below illustrates it best)

What is the expected behavior?

Clicking the “prev” button should not produce any effects associated with “next”.

How would you reproduce the current behavior (if this is a bug)?

I am animating the pages to slide into view with some jquery/css. If you add click events to either button, and navigate back to the first page, you will find a conflict.

Provide the test code and the tested page URL (if applicable)

This plnkr doesn’t show the css animation, but if you view the developer console while in plnkr and inspect the html elements as you click previous and next, you will see the incorrect class names being added/removed (‘slideInFromLeft’, ‘slideInFromRight’) They are reversed when navigating to AND from the first page. The page should slide in from the right when you answer, or click next. It should slide from the left when you click previous. This is what I’m seeing locally (you can even see the incorrect button become active with focus applied): slide

Specify your

  • browser: Chrome
  • browser version: 58
  • surveyjs platform jquery
  • surveyjs version: 0.12.16 dev version

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
batmanburycommented, Jun 13, 2017

For anyone interested as it turns out, survey.onAfterRenderQuestion was what I ended up using for getting the animation to work properly.

When changing styles based on page changes, this is much more reliable than survey.onCurrentPageChanged.

1reaction
batmanburycommented, Jun 9, 2017

@dmitrykurmanov @andrewtelnov Sorry! I thought I had included it in the original description.

http://plnkr.co/edit/70RZCgNGsQQEiBjgEHPZ?p=preview

If you go to the last question (question 4), don’t complete the survey. Instead click Previous while looking at the developer console. You will see some console.log() statements.

If you click Previous, it should log “You clicked PREVIOUS” and if you click Next, “You clicked NEXT”

But once you hit the first page again, they trigger incorrectly, but somehow go to the correct page.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JS trigger next button and previous button through selected ...
I have the next/previous button hidden on my intro page and have the survey set to auto advance once an answer has been...
Read more >
Prevent table row onclick event to fire when clicking button ...
I have a table row with ONCLICK event (that toggles additional data below). Inside one of the row cells I have a button...
Read more >
Call JavaScript functions from .NET methods in ASP.NET Core ...
Learn how to invoke JavaScript functions from .NET methods in Blazor apps.
Read more >
Lightning Aura Components Developer Guide
Get Your Aura Components Ready to Use on Lightning Pages . ... The onclick event handler on the lightning:button component.
Read more >
JavaScript [Archive] - Page 40 - Dynamic Drive Forums
Resolved Non-coder, hitting a roadblock with first JS. Function with URL call · Convert iframe target to Javascript / ajax div? Coda Slider...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found