2
votes

I am using Datatables to sort and filter my tables. When you activate Datatables, there is a search field. In Chrome, Firefox, Edge and Internet Explorer 11 there is a clear button present with every search input field.

enter image description here

When you click on it, the text is cleared and the table will reset. Except in Microsoft Edge, this does not work. The table is not resetting.

Is this an issue with Microsoft Edge or Datatables?

3
If you have implemented a steady, working solution for DataTables filter input I think you should post it as answer here and accept it. Will happily upvote such answer, it is needed.davidkonrad
As one of the answers indicates... This is an Edge bug. Please poke Microsoft about this issue. developer.microsoft.com/en-us/microsoft-edge/platform/issues/…AnthonyVO

3 Answers

1
votes

I believe it is Edge that not is triggering the events the DT input is listening on. That is keyup, keydown, keypress, cut and paste ...There is two additional events that is fired when you click on the search input clear button: mousedown and mouseup.

You could create event handler that force a redraw when mouseup is triggered :

$('.dataTables_filter input').on('mouseup', function() {
  table.draw()
})

See this question where the issue is discussed more thoroughly -> Event fired when clearing text input on IE10 with clear icon

1
votes

This is a known bug found in build 17.17134 of Edge.

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17584515/

I am using an earlier version and it still works.

0
votes

I try to make a test on my side with EDGE and got the same result like yours.

When click on 'X' it is not reset the table.

Click here to see testing result

Then i made some other tests and find that if you use BackSpace key to clear the search text then it will work as expected.

If you use 'X' button then after text get clear you need to press enter to reset the data.

I agree with other community members that Edge is not triggering the event to reset data.

I think you need to submit your feedback to Datatables site. So that they modify their code which can work properly with Edge.

Regards

Deepak