[Bug] Wizard event "click.fu.wizard" should not fire when content includes li elements #1877

Closed
aiperon opened this Issue Sep 30, 2016 · 2 comments

Projects

None yet

2 participants

@aiperon
Contributor
aiperon commented Sep 30, 2016 edited

I've noticed unexpected steps switching on Wizard widget.

  • Add the next code to the first .step-pane element:
<ul>
  <li class="complete">First item</li>
  <li class="complete">Second item</li>
</ul>
  • Click on "First item" row

Expected result: nothing should happened.
Actual result: last step would be activated.

The reason is selector for steps elements ("li.completed") located inside all of the wizard element:
https://github.com/ExactTarget/fuelux/blob/master/js/wizard.js#L60

My suggestion:

var stepsContainer = this.$element.children('steps-container')
stepsContainer.on('click.fu.wizard', 'li.complete', $.proxy(this.stepclicked, this));

Could I provide PR for that?

@aiperon aiperon changed the title from [Bug] Wizard event "click.fu.wizard" should not fire when content include li elements to [Bug] Wizard event "click.fu.wizard" should not fire when content includes li elements Sep 30, 2016
@cormacmccarthy
Contributor
cormacmccarthy commented Sep 30, 2016 edited

Yes, please do provide a PR!

Please provide unit tests for this as well.

Good catch, thank you!

@cormacmccarthy cormacmccarthy added this to the On Deck milestone Sep 30, 2016
@aiperon
Contributor
aiperon commented Oct 10, 2016

@cormacmccarthy Could you take a loot at the PR #1879 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment