bluewatertracks / bwt-datatable

Data table with Polymer 3 support!
GNU General Public License v3.0
42 stars 14 forks source link

Row keys don't match displayed row data #50

Closed the-realtom closed 5 years ago

the-realtom commented 6 years ago

This fix seems to be the culprit: #40 I'm experiencing an issue where the row keys don't match the actual data displayed in that row. So when a row is selected, the selected data is from a different row. In the below screenshots I just added a \<h1> tag to show the rowKey. So as seen below, if you select the second row, it will select data from row 9. 3

This line always evaluates to false which causes the _internalSort to run (which messes with the row keys). https://github.com/bluewatertracks/bwt-datatable/blob/76622ba11ba09a4644102f337bf61832b0cfa2e7/bwt-datatable.html#L976

This is strange, because ev.preventDefault() is definitely being called, but the defaultPrevented property of the event isn't changing to true. I've verified this though debugging and even checking the event object straight after ev.preventDefault() is called. https://github.com/bluewatertracks/bwt-datatable/blob/76622ba11ba09a4644102f337bf61832b0cfa2e7/bwt-datatable-card.html#L419-L425

Also I can't understand why ev.preventDefault() is needed at all since it's a custom event? Maybe somone can explain this to me. Thanks!

mirnpnh commented 5 years ago

Hi, @the-realtom I am facing same issue on a production application if you could come up with a fix for it i would appreciate it if you could share it.

@maisnamraju @IchordeDionysos @binhbbbb

dhrytsenko commented 5 years ago

@Innomalist @the-realtom I'll check ASAP