best_in_place
best_in_place copied to clipboard
date field sends data to controller on pressing ESC for cancel
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.