guillaumepotier / Garlic.js

Automatically persist your forms' text and select field values locally, until the form is submitted.
http://garlicjs.org/
Other
2.37k stars 176 forks source link

Issue with bootstrap data-dismiss="modal" attribute on reset #39

Open sturlaj opened 11 years ago

sturlaj commented 11 years ago

This might not be an issue with Garlic.js, but there is a conflict when using a bootstrap modal cancel button and garlic

[button class="btn" data-dismiss="modal" type="reset"]Close modal and clear data[/button]

Despite the type being set to reset, the local storage is not cleared when the button is pressed (due to whatever happens to data-dismiss). I found a workaround, but it makes the code a bit messy

[button class="btn" onclick="$('#myModalId').modal('hide');" type="reset"]

johnstrickler commented 11 years ago

This issue just came up for me as well. I'm going to have to use a programmatic workaround as well.