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

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

Open
matthewhegarty opened this issue Nov 30, 2022 · 1 comment

Comments

@matthewhegarty
Copy link
Contributor

matthewhegarty commented Nov 30, 2022

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
Copy link
Contributor Author

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");
  }
});

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

1 participant