-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add @ to onClick
in BsModal::Footer submit button
#2123
Add @ to onClick
in BsModal::Footer submit button
#2123
Conversation
Great catch. My assumption would be that If that assumptions is correct, the ember-bootstrap/ember-bootstrap/addon/components/bs-button.ts Lines 421 to 457 in 7b66df9
The promise state is used in Would be great if you could double check that. Maybe even add a test case for it. |
After testing your assumption seems to be correct. It uses the browser's
Edit: |
…ng promise Due to a missing `@`, the promise was initially ignored and two separate click handlers would fire for the submit button: One in BsModal::Footer and the other in BsButton. By adding back the `@` and conditionally setting the `disabled` field on the submit button, any promise that is returned from the `@onSubmit` function will now disable the button until the promise is settled
To get the pending state to work as expected, I had to create a modifier for conditionally setting an attribute on an element. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. Didn't had the time for a detailed review yet. But what I have seen so far looks great. Only one small change to dependency management.
That's fine! I don't see the comment about the dependency management though. Should something be changed in |
Arghs. Somehow my review comment got lost. In short: I think ember-modifier should be a peer dependency. It is added as a dependency for every app in Ember CLI blueprints. Ember Bootstrap introduces a peer dependency on ember-modifier indirectly already today. Ember Bootstrap depends on ember-style-modifier. Ember-style-modifier has a peer dependency on ember-modifier. Supported range for ember-modifier peer dependency should be the same as ember-style-modifier supports. In that case it wouldn't be a breaking change. At least in my understanding of our informal SemVer commitment for dependency management. |
Ah, that makes sense. I've check |
Good catch! I assumed it does. But it does not. Same for ember-popper-modifier. Both declare it as dependencies only. I guess that should be changed upstream as well at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Especially the improved test coverage. Great job!
As part of the Typescript conversion of
bs-modal
, I noticed that the@
on@onClick
was missing for the submit button.I have added tests for the submit and close button, and they seem to be fine with or without the
@
, but to keep in line with Ember's usual style, we should put the@
in there anyway.