# Table scrolling to first row

**URL:** <https://forum.wixstudio.com/t/table-scrolling-to-first-row/25905>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [February 13, 2020, 12:27pm UTC](https://forum.wixstudio.com/t/table-scrolling-to-first-row/25905 "2020-02-13T12:27:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgilbert](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@bgilbert](https://forum.wixstudio.com/u/bgilbert)\
**Post date:** [February 13, 2020, 12:27pm UTC](https://forum.wixstudio.com/t/table-scrolling-to-first-row/25905/1 "2020-02-13T12:27:55Z")

</div>

I created a dynamic linked table. The table lets the user browse through a list of vehicles and click a row to bring up a picture of the element in that row.

When the user clicks on a row, it automatically scrolls back to the top of the table. I have over 200 rows so this is a problem.

I have tried event.preventdefault, and scrolling to the row after clicking but neither work. I suspect the scrolling isn’t working as the data is still ‘loading’ after the click.

Any help? (i removed some of the code which checks unrelated elements/gathers the element info from the row to assign to box1, text1, image1)

export function table1\_rowSelect\_1(event) {  
//$w(’ [#table1](https://www.wix.com/corvid/forum/search/~num~table1) ').onRowSelect(thirdEvent =\> { thirdEvent.preventDefault(); });  
[//event.preventDefault();](https://event.preventDefault();)  
 //neither of the above worked

let rowData = event.rowData;  
let rowIndex = event.rowIndex

console.log(rowData);  
$w(‘#dynamicDataset’).onCurrentIndexChanged( (secondEvent) =\> {  
let itemData = $w(“#dynamicDataset”).getCurrentItem();  
console.log(itemData);  
} );

$w(‘#box1’).show(“fade”,fadeOptions);  
$w(‘#text1’).show(“fade”,fadeOptions);  
$w(‘#image1’).show(“fade”,fadeOptions);  
$w(‘#table1’).scrollTo(rowIndex);  
console.log(rowIndex);  
}

---

<div class="post-metadata">

**Author:** ![jflangella](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jflangella](https://forum.wixstudio.com/u/jflangella)\
**Post date:** [November 8, 2020, 4:24pm UTC](https://forum.wixstudio.com/t/table-scrolling-to-first-row/25905/2 "2020-11-08T16:24:55Z")

</div>

I have the same problem , a nightmare how can we fix this bug . ?

---

<div class="post-metadata">

**Author:** ![frysingertad](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/frysingertad/32/10794_2.png) [@frysingertad](https://forum.wixstudio.com/u/frysingertad)\
**Post date:** [January 22, 2022, 3:21pm UTC](https://forum.wixstudio.com/t/table-scrolling-to-first-row/25905/3 "2022-01-22T15:21:39Z")

</div>

Did anyone ever find a solution to this? I am seeing it also.
