Skip to content

Commit cfbc858

Browse files
committed
Fixed #256 : [BUG] Scrolling Issue with iloc in Subset App
When iloc is selected in Subset app - Fixes incorrect indexing issue - Resolves scrollbar being fixed downwards, preventing number clicking and scrolling up.
1 parent fca3d9b commit cfbc858

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

visualpython/js/m_apps/Subset.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ define([
343343
$(this.wrapSelector('.select-row .vp-ds-select-box.left')).on('scroll', function() {
344344
if ($(this).scrollTop() + $(this).innerHeight() >= ($(this)[0].scrollHeight - 2)) {
345345
let scrollPos = $(this).scrollTop();
346+
if (that.state.rowLimit > that.state.rowList.length){
347+
return; // Prevents scroll from being fixed downwards
348+
}
346349
let start = that.state.rowLimit;
347350
let end = start + 10;
348351
let subsetVariable = com_util.formatString('{0}.iloc[{1}:{2}]', that.state.pandasObject, start, end);
@@ -361,9 +364,9 @@ define([
361364
rowList = rowList.map(function (x) {
362365
return {
363366
...x,
364-
label: x.location + '',
365-
value: x.location + '',
366-
code: x.location + '',
367+
label: x.label + '',
368+
value: x.value + '',
369+
code: x.code + '',
367370
};
368371
});
369372
}

0 commit comments

Comments
 (0)