[3.0.0+] Scroll to Top of Window when Selecting Cells
Description
When selecting cells in a different column of the table, the window is scrolled to the top of the page. If selecting other cells in the same column no scrolling occurs.
I have a table that has 3 columns; dropdown, input, input (numeric). Looking at the rendered HTML there are 3 separate handsontableInputHolder (after selecting different column cell, can see each element created/added with first selection of the cell)
I attempted to set preventScrolling in the afterSelection hook, also editing the source directly in several spots that seemed likely - obviously non worked.
Steps to reproduce
- create a table with multiple columns and input types
- add the table to an element below the fold of the browser window
- select a cell in one of the columns (scroll should occur)
- select a cell in a different column
Demo
issue is present in tutorial for scrolling ... occurs with first cell selection, but not after since using the same editor (I assume). ie. refresh the page to see the issue again.
https://docs.handsontable.com/4.0.0/demo-scrolling.html
Your environment
- Handsontable version: 4.0.0
- Browser Name and version: Firefox 60.0.2
- Operating System: Linux Mint 18.2

@table = Handsontable(@taxtableEl[0],
data: data,
autoInsertRow: true,
autoWrapCol: false,
autoWrapRow: false,
minSpareRows: 2,
minRows: 10,
colHeaders: ['State', 'ZIP code', 'Percent'],
colWidths: [160, 90, 60],
columns: [
{
type: 'dropdown',
source: @states,
readOnly: @readOnly,
},
{
validator: @isValidZipCode,
allowInvalid: true,
readOnly: @readOnly,
renderer: @validationRenderer,
},
{
type: 'numeric',
numericFormat: {pattern: '0.0'},
allowInvalid: true,
readOnly: @readOnly,
renderer: @validationRenderer,
}
],
contextMenu: true
)

I was literally just in the API docs and it does this on chrome mobile. I thought to myself how does anyone think of using this if it scrolls to the top every time you interact with it. Was going to post this exact issue 👍
For reference, I was on my phone and it happened on every table and every cell on this page https://docs.handsontable.com/pro/4.0.0/demo-filtering.html
Thank you for sharing. I have replicated it with Firefox 60 and 61 on Windows 10. Chrome 67 doesn't seem to share this behavior.
@AMBudnik it does happen on chrome mobile 67. I just had it happen on another phone.
Thanks for checking @tsteuwer-accesso
This does not occur using handsontable 3.0.0 (I am using a hack to remove the invalid css though re: #4896)
Thanks @wayne-weibel
You're right. I have just checked the https://docs.handsontable.com/4.0.0/demo-scrolling.html on FF 61 and it works fine.
Broken in 5.0.1: http://jsfiddle.net/6kusa17w/ And fixed in 5.0.2-RC: http://jsfiddle.net/jzngr938/
Thank you for reporting the investigation results guys! I am happy that this one got solved. If you'd have any similar issues please let me know.
Hi guys, i have got still a scrolling problem when the table gets rotated :\ is there a way how to fix it? Thank you. Here is an example: http://jsfiddle.net/9urg2o13/ (was testing it in firefox)
I have managed to fix it by creating a custom editor, but now im getting a problem that the copy paste is not working.. what should i do to make the copy paste functionality working? Im extendint the TextEditor
Hi @arfis can you share your code in the JSFiddle? I'll test it