-
Notifications
You must be signed in to change notification settings - Fork 32
Form submission with required field #33
Comments
Hello there! Thanks for reporting! I made a commit which allows you to configure the button selector via the BTN_SELECTOR property of the config. If this doesn't work: Could you by any chance provide a plunkr or something of the sort illustrating the issue? |
Hello ! I applied you commit but it didn't fixed the issue. You just have to click "Login" |
The answer is simple: You're not giving the button any type of promise. Imho otherwise you won't need a loading spinner anyways, as the action is happening instantly. See this example: https://plnkr.co/edit/i51lgyIs9hSqhSiJ5UTG?p=preview |
To quote the Readme you need to do one of the two:
|
When the form is valid, there are no issues with a valid promise. However, if you open the plunkr, hit login with an empty password, the login method is not called (you don't see the alert, the promise is not returned to the button) but the spinner is displayed. I tried on Chrome & Edge, same behaviour. Edit : I have a solution, let me create a PR :) |
PR : @ #34 |
Thank you for the pr. I'm not really sure, if I want to add form validation checks with this directive though as there might be unintended side effects (usually I handle validation with ng-fab-form). My first thought would be to pass the promise to the directive directly (e.g.: |
I debugged the issue a little further: This only occurs together when the option |
Good spot ! I guess I misunderstood the You can reject my PR, I'll set the option to false and think a bit more of how to disable the other buttons of the form while waiting for the promise. Thanks for your help ! |
Hi,
When submitting a form with required empty fields, the loading class is added to the button and not removed.
Here is my implementation :
and my controller
and my config
The submitLogin function is only called when the form is valid and I don't want to disable it when the form is invalid.
I am happy to investigate this a bit more and create a PR but I need some guidance on where to look to make the code looking for the $valid property of the form.
Thanks
Clem
The text was updated successfully, but these errors were encountered: