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

Bug: Event handlers are no longer bound in edge case #653

Closed
gilbert opened this Issue Apr 5, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@gilbert
Copy link
Contributor

gilbert commented Apr 5, 2017

Bug Report

After two renders, a click handler no longer triggers. This bug was introduced in 4.2.0 (4.2.3 still has the bug, but 4.1.3 works perfectly).

Context

class {
  onCreate(input) {
    this.state = { mode: input.mode || 'sign-up' }
  }
  setType(value) {
    this.state.mode = value
  }
}

<form class="session-panel">

  <div class="sign-up" if(state.mode === 'sign-up')>
    <h3>Create Account</h3>
    <div class="switch">
      Already have an account?
      <sign-in-link />
    </div>
  </div>

  <div class="sign-in" if(state.mode === 'sign-in')>
    <h3>Sign In</h3>

    <div class="switch">
      Don't have an account?
      <sign-up-link />
    </div>
  </div>
</form>

<macro sign-in-link>
  <a on-click('setType', 'sign-in')>&nbsp;Sign&nbsp;in&nbsp;›</a>
</macro>

<macro sign-up-link>
  <a on-click('setType', 'sign-up')>&nbsp;Create&nbsp;your&nbsp;account&nbsp;›</a>
</macro>
  1. Click "Sign in"
  2. Click "Create your account"
  3. Click "Sign in" again

Expected Behavior

It should go back to the Sign in mode.

Actual Behavior

Nothing happens :)

Additional Info

Your Environment

  • Version used: 4.2.x
  • Environment name and version: Chrome 56
  • Operating System and version (desktop or mobile): OS X 10.11
@patrick-steele-idem

This comment has been minimized.

Copy link
Contributor

patrick-steele-idem commented Apr 5, 2017

Found the problem. Working on a fix.

@patrick-steele-idem

This comment has been minimized.

Copy link
Contributor

patrick-steele-idem commented Apr 5, 2017

New version published with fix: marko@4.2.4

Thanks for reporting the problem @mindeavor and making it easy to reproduce as always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.