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

Button attribute not updating using classic components syntax #295

Open
tehmaestro opened this issue Apr 21, 2021 · 1 comment
Open

Button attribute not updating using classic components syntax #295

tehmaestro opened this issue Apr 21, 2021 · 1 comment

Comments

@tehmaestro
Copy link

Version

3.14.0

Test Case

https://ember-twiddle.com/32cb49c696b4b7ca2736b1e3a8c98599?openFiles=components.my-component%5C.js%2Ctemplates.components.my-component%5C.hbs

Steps to reproduce

Hey. Use the twiddle above, and press the Toggle email value button. This button sets the email field, which is being validated, to either some value, or empty .. we are validating for presence.

Expected Behavior

All buttons should be disabled. When email value is set, buttons should be enabled.

Actual Behavior

When using the classic component syntax, with the latest version of changeset, I saw that the button's disabled attribute was not being updated. This happens only when using changeset.isInvalid directly, without any additional helpers. Notice the button with this works, however, I've never used this inside one of my components (classic syntax), so I'm not even sure why that works.

I'm on my way of upgrading an Ember project to Octane, and I figured I should upgrade to the latest version of Ember (3.24 actually), before beginning the migration to Glimmer Components. So I had to update ember-changeset , however, I found this bug.

Do you guys have any suggestions? Why is this happening? Should I use an if helper, until I migrate the component to native class syntax, Octane, all that good stuff?
Also, how come printing change.isInvalid directly in the template works, but as a button attribute, it does not?
Thanks!

@snewcomer
Copy link
Collaborator

Hi! Just to confirm since I didn't see it laid out explicitly - does the glimmer version update correctly? Or haven't you made it that far yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants