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

Aurelia if custom attribute does not work if it's rebound #315

Closed
zenorbi opened this Issue Oct 3, 2017 · 7 comments

Comments

Projects
None yet
5 participants
@zenorbi

zenorbi commented Oct 3, 2017

I'm submitting a bug report

  • Library Version:
    1.5.1

Please tell us about your environment:

  • Operating System:
    OSX 10.13

  • Node Version:
    v8.6.0

  • NPM Version:
    5.3.0
  • JSPM OR Webpack AND Version
    aurelia-cli 0.31.3
  • Browser:
    all

  • Language:
    ESNext

Current behavior:
Rebinding a view having an if custom-attribute does not rebind the subviews inside the if.

Expected/desired behavior:

@bigopon

This comment has been minimized.

Show comment
Hide comment
@bigopon

bigopon Oct 3, 2017

Member

What browser did you get the wrong behavior ? It's working fine for me, the button is doing its job properly. Did you miss anything in bug reproduction instruction ?

Member

bigopon commented Oct 3, 2017

What browser did you get the wrong behavior ? It's working fine for me, the button is doing its job properly. Did you miss anything in bug reproduction instruction ?

@zenorbi

This comment has been minimized.

Show comment
Hide comment
@zenorbi

zenorbi Oct 3, 2017

@bigopon Chrome Version 61.0.3163.100 (Official Build) (64-bit) also using Firefox 56.0 (64-bit)

Please make sure you use the repo I linked as the gist version uses an older aurelia-templating-resources.

Clone the repo, run npm i, au run then follow the instructions provided in the app.html.

zenorbi commented Oct 3, 2017

@bigopon Chrome Version 61.0.3163.100 (Official Build) (64-bit) also using Firefox 56.0 (64-bit)

Please make sure you use the repo I linked as the gist version uses an older aurelia-templating-resources.

Clone the repo, run npm i, au run then follow the instructions provided in the app.html.

@bigopon

This comment has been minimized.

Show comment
Hide comment
@bigopon

bigopon Oct 3, 2017

Member

Only happen to nested if. The View of nested if will not call bind for some reason

Member

bigopon commented Oct 3, 2017

Only happen to nested if. The View of nested if will not call bind for some reason

@zenorbi

This comment has been minimized.

Show comment
Hide comment
@zenorbi

zenorbi Oct 3, 2017

Well not just in case of nested ifs, but any if binding where you unbind then bind the view again which has an if attribute somewhere inside it. The outside if is just the simplest way to get a view then unbind and rebind it.
In our internal project we use a caching aurelia ViewFactory where the created view only has a single if binding but due to caching we reuse thus rebind the view multiple times.

zenorbi commented Oct 3, 2017

Well not just in case of nested ifs, but any if binding where you unbind then bind the view again which has an if attribute somewhere inside it. The outside if is just the simplest way to get a view then unbind and rebind it.
In our internal project we use a caching aurelia ViewFactory where the created view only has a single if binding but due to caching we reuse thus rebind the view multiple times.

@nenadvicentic

This comment has been minimized.

Show comment
Hide comment
@nenadvicentic

nenadvicentic Oct 10, 2017

Same problem here.
After template is hidden and shown again, delegate binding on some items does not work any more.

<template if.bind="...">
    <button if.bind="..." click.delegate="doSomething()"></button>
</template>

nenadvicentic commented Oct 10, 2017

Same problem here.
After template is hidden and shown again, delegate binding on some items does not work any more.

<template if.bind="...">
    <button if.bind="..." click.delegate="doSomething()"></button>
</template>

discoaaron added a commit to discoaaron/templating-resources that referenced this issue Oct 11, 2017

fix(if-core.js): child view re-binding issue
sets showing to false on unbind to ensure binding is carried out when view is re-shown
nested views were not re-bound when parent was re-shown

Resolves
aurelia#317
aurelia#315
@jods4

This comment has been minimized.

Show comment
Hide comment
@jods4

jods4 Oct 18, 2017

Contributor

#317 is a duplicate of this but contains an analysis of the cause and a proposed solution in a comment.

@EisenbergEffect We can close this issue and track the problem with #317.

Contributor

jods4 commented Oct 18, 2017

#317 is a duplicate of this but contains an analysis of the cause and a proposed solution in a comment.

@EisenbergEffect We can close this issue and track the problem with #317.

@EisenbergEffect

This comment has been minimized.

Show comment
Hide comment
@EisenbergEffect

EisenbergEffect Oct 19, 2017

Member

Closing as duplicate of an issue that we've merged the fix for. See #317

Member

EisenbergEffect commented Oct 19, 2017

Closing as duplicate of an issue that we've merged the fix for. See #317

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