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

CustomAttribute is not being evaluated when on or inside an if.bind-Element #680

Open
DarkLiKally opened this issue Feb 13, 2020 · 5 comments
Labels

Comments

@DarkLiKally
Copy link

I'm submitting a bug report

  • Library Version:
    1.10.3

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    10.13.0

  • NPM Version:
    6.12.0

  • JSPM OR Webpack AND Version
    It's an Aurelia Plugin created using the CLI. It's using gulp based build with npm

  • Browser:
    all

  • Language:
    TypeScript 3

Current behavior:

I'm not sure whether it's plugin specific or a general issue, I haven't had the time to test it in a normal app.

  1. Create a custom attribute
  2. Register the custom attribute in global resources
  3. Create a custom component / element
  4. create an element (i.e. div) with an if.bind attribute, make the condition initially false
  5. add the custom attribute to the same element or any child element of it.
  6. start the application, the custom attribute won't be evaluated
  7. make the if.bind-condition somehow true using a button or timeout
  8. the element get's shown but the custom attribute is still not being evaluated.

If the attribute is on an element with initally true for if.bind or a generally visible element, it is working fine.

  • What is the expected behavior?
    The custom attribute should be evaluated / applied / bound / executed even on toggled elements using if.bind

  • What is the motivation / use case for changing the behavior?
    We should be able to hide complex element structures from the DOM and still be able to use custom attributes.

@BlischkeFlorian
Copy link

Totally agree - massive Bug.

@BlischkeFlorian
Copy link

@EisenbergEffect any plans to fix this heavy issue?

@bigopon
Copy link
Member

bigopon commented Feb 18, 2020

@BlischkeFlorian thanks for notifying. Ill have a look

@bigopon
Copy link
Member

bigopon commented Feb 18, 2020

@BlischkeFlorian @DarkLiKally reading the description in this issue, it seems you want the if attribute to behave similarly to show attribute, is that correct? If so, can you described why you cannot use show attribute?

@bigopon
Copy link
Member

bigopon commented Feb 18, 2020

@BlischkeFlorian @DarkLiKally Sorry I misread your description. It seems the custom attribute value doesn't get updated. Could you please help with a repro based on this sandbox? https://codesandbox.io/s/zw9zjy0683

The issue you reported seems like a common usage to me, so it should have been notified by many others. I'm not sure why it doesn't work for you, so probably we will need the exact code that failed in your project.

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

3 participants