Get current viewport in v14.5.0
Describe the bug
Hi,
I've discovered an issue after upgrading to v14.5.0. I'd like to keep the viewport before updating the data, so I save the viewport by using the getFirstVisibleColumn/getFirstVisibleRow and after the update is finished I set the saved values back by using scrollViewportTo.
It still works just fine, when there are no merged cells. However, in the case of a merged cell reaching from column 0 to column 100 the getLastVisibleRow/getLastVisibleColumn returns incorrect values (see example below). Same for getFirstVisibleColumn/getFirstVisibleRow when you're scrolling. getFirstVisibleRow returns in every case 0.
Video/Screenshots
No response
Provide a link to the demo with the bug reproduction
https://jsfiddle.net/TSchrempf/n7gzhky2/30/
Handsontable version
14.5.0
Framework version
No response
Your environment
macOS and Chrome
Hi @conschtek
Thank you for the message, and sorry for the confusion (I'd request to add this detail to the docs).
Merge area is extending column virtualization, so the getLastVisibleColumn will return the last column index from the merged area.
If you'd like to get the actual value, you may want to use private instance.view methods. It is not recommended (as it's private), but if you'd like to have it working now, that might be the only option.
Here's an updated demo https://jsfiddle.net/b5dmtnuy/
Hi @AMBudnik
Thank you for your quick answer and workaround! It works just fine.
Hi @AMBudnik, I am also having issues with getLastVisibleRow since 14.5.0. Regarding your workaround, is there a reliable way to get the first and last visible rows in the future, since you say the workaround is not recommended?
Hi @micahbf
are you looking for a getLastVisibleRow in general, or do you also use merged cells within a larger rowspan applied? If you could share any examples/drafts that would be helpful.