diff --git a/src/editors/selectEditor.js b/src/editors/selectEditor.js index a93c92f12dc..c5afb1a87ad 100644 --- a/src/editors/selectEditor.js +++ b/src/editors/selectEditor.js @@ -156,7 +156,8 @@ class SelectEditor extends BaseEditor { * @private */ refreshValue() { - const sourceData = this.hot.getSourceDataAtCell(this.row, this.prop); + const physicalRow = this.hot.toPhysicalRow(this.row); + const sourceData = this.hot.getSourceDataAtCell(physicalRow, this.prop); this.originalValue = sourceData; this.setValue(sourceData); diff --git a/test/e2e/editors/selectEditor.spec.js b/test/e2e/editors/selectEditor.spec.js index b66ed44468f..c2f3f3474f3 100644 --- a/test/e2e/editors/selectEditor.spec.js +++ b/test/e2e/editors/selectEditor.spec.js @@ -303,6 +303,29 @@ describe('SelectEditor', () => { expect(window.getComputedStyle(editor, 'focus').getPropertyValue('outline-style')).toBe('none'); }); + it('should render proper value after cell coords manipulation', () => { + const hot = handsontable({ + data: [ + ['0, 0', '0, 1', '0, 2'], + ['1, 0', '1, 1', '1, 3'] + ], + editor: 'select', + selectOptions: [ + '0, 0', '0, 1', '0, 2', + '1, 0', '1, 1', '1, 3' + ] + }); + + hot.rowIndexMapper.setIndexesSequence([1, 0]); + hot.columnIndexMapper.setIndexesSequence([2, 1, 0]); + + selectCell(0, 0); + getActiveEditor().beginEditing(); + getActiveEditor().refreshValue(); + + expect(getActiveEditor().originalValue).toEqual('1, 3'); + }); + it('should populate select with given options (array)', () => { const options = [ 'Misubishi', 'Chevrolet', 'Lamborgini'