vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
732 stars 285 forks source link

'bootstrap-datetimepicker' field remains highlighted after clicking 'clear' #671

Open matthewhegarty opened 1 year ago

matthewhegarty commented 1 year ago

When using 'bootstrap-datetimepicker', if the 'clear' button is clicked, then the date value is cleared, but the inuse highlighting remains. I think it would be ideal if this highlighting were cleared when the 'clear' button is clicked.

Screenshot 2022-11-30 at 11 17 12

JS Fiddle

To reproduce:

  1. Click 'From'
  2. Choose a date (e.g. '01 Jan 2000')
  3. The table refreshes correctly
  4. Open the 'From' field and click the 'clear' button
  5. The date is cleared but the inuse highlighting remains
matthewhegarty commented 1 year ago

This is the workaround I used to fix this:

$(".daterangepicker").on("dp.change", function (e) {
  if (e.date === false) {
    $(e.target).closest("input").removeClass("inuse");
  }
});