spatie / vue-table-component

A straight to the point Vue component to display tables
http://vue-table-component.spatie.be
MIT License
588 stars 149 forks source link

Table breaks on IE11 when filter is active #131

Closed viezel closed 6 years ago

viezel commented 6 years ago

The table is not shown in IE11 if show-filter is true. It works fine in any other browser.

<table-component :data="{{ $data }}" :show-filter="true">

This is also the case for the demo page: http://vue-table-component.spatie.be/

I have not found the reason atm this moment, still trying to debug why. It seems that IE11 filters all the data, so we end up with "There are no matching rows"

It might be the includes method that is not supported by IE, https://github.com/spatie/vue-table-component/blob/master/src/classes/Row.js#L58

@sebastiandedeyne any idea ?

sebastiandedeyne commented 6 years ago

It's probably that, should be solved by adding an Array.includes polyfill to your project.

viezel commented 6 years ago

@sebastiandedeyne yep, thats it. Would you be open to me doing PR to fix this? So this component works out of the box. The filter feature is on by default, so every IE browser will be broken, if people dont install the polyfill.

changing the Row.js line 58 to:

.filter(filterableValue => filterableValue.indexOf(filter.toLowerCase()) >= 0)