I'm submitting a ... (check one with "x")
[X] bug report => Search github for a similar issue or PR before submitting
Plunkr Case (Bug Reports)
I couldn't get the plunkr template to run karma tests... so here's a gist with a complete self-sufficient test case:
https://gist.github.com/HonoluluHenk/93ad431bb6185533334fed71d9e3faff
Current behavior
Sorting a p-table unexpectedly tries to modify the underlying data array.
Worse, this errors out on frozen arrays.
Probably related to #2630 and #2529
Expected behavior
Data should not be modified.
Minimal reproduction of the problem with instructions
Set the value of a p-table to a frozen array, define some sort column, run everything and click the sort header => exception thrown
What is the motivation / use case for changing the behavior?
Unexpected behavior, exception.
Please tell us about your environment:
FYI, it happens for instance when you want to use ngrx observable with an async pipe directly.
If I have a table
<p-table [value]="datathreadResults$ | async">...
the following in TS聽file wont work with message :
this.datathreadResults$ = this.store.select(state => state.datathread.datathreadResults));
ERROR TypeError: "0 is read-only"
sortSingle primeng-table.js:712
ngOnChanges primeng-table.js:51
I'm currently adding a map operation to go around this issue :
this.datathreadResults$ = this.store.select(state => state.datathread.datathreadResults).pipe(map(datathread => [...datathread]));
Set [focusOnShow]="false" to disable auto focus of Dialog if you need to manage focus yourself.
@cagataycivici Uhm... Neither is this fixed nor is your comment relevant to the problem :(
Was your comment/closing the issue really meant?