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

Drab.Modal.alert / Bootstrap 4 fails to close the box on "Cancel" button #159

Closed
guidotripaldi opened this issue Aug 27, 2018 · 3 comments
Closed

Comments

@guidotripaldi
Copy link
Contributor

After upgrading to Drab 0.9.2 and setting the config to Bootstrap4

config :drab, :modal_css, :bootstrap4

calling the Drab.Modal.alert/4 shows the box, but it responds only to OK and close (x) buttons, clicking on the CANCEL button it doesn't do anything

Drab.Modal.alert(socket, "Message", "Sure?", buttons: [ok: "OK", cancel: "CANCEL"])
@grych
Copy link
Owner

grych commented Aug 29, 2018

Hi @guidotripaldi, thanks for reporting!

Unfortunatelly, I can's reproduce the issue?

By any chance, are you using the custom template for a cancel button? (file modal.alert.button.cancel.html.eex)

Also, can you check if this https://github.com/grych/drab_example_bootstrap4 works? It is an empty app with BS4 and Drab installed.

@guidotripaldi
Copy link
Contributor Author

yes, I have a custom template for the cancel button, it is defined this way:

<button id="_drab_modal_button_cancel" type="button" name="cancel" class="btn btn-outline-primary" data-dismiss="modal">
   <%= label %>
</button>

I noticed only now that the problem depends by the lack of the class drab-modal-button in my custom button definition, adding it makes the button "cancel" works again.
The documentation of Drab.Modal states clearly that the custom button must have the drab-modal-button class, but its is missed in the CHANGELOG.mdfile, so when did my refactory after Drab upgrade I wasn't aware of it.

@grych
Copy link
Owner

grych commented Aug 29, 2018

True, I have forgotten to mention that this is a breaking change for those having custom buttons already. Apologies.

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