bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 574 forks source link

date field sends data to controller on pressing ESC for cancel #584

Open dhaliman opened 7 years ago

dhaliman commented 7 years ago

I've a date field <%= best_in_place instance, :date, as: :date, display_as: :formatted_date, place_holder: '-', class: 'js-in-place-editing', inner_class: 'form-control' %> Whenever there's a validation error, the text turns red. And if the update is a success it turns green.

Whenever I click on the date field, I see the datepicker. Now if I press cancel, it still sends a request to my controller. This doesn't happen with other fields. Only this.

This is a problem for me because every time I cancel the text changes colour but it shouldn't. and it doesn't get displayed with the display_as option.