Skip to content

Commit

Permalink
Fix a bug resulting in incorrect offsets with dynamic rows
Browse files Browse the repository at this point in the history
.find() will find the first <thead> in the tree underneath the table - including child tables.  .children() will, instead, locate the <thead> of our table.  .children() is what we want, and using .find() has caused issues with drag and drop functionality in the backend.
  • Loading branch information
navarr authored Oct 24, 2016
1 parent d7a3849 commit 2a9fa0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ define([
drEl.instanceCtx = this.getRecord(originRecord[0]);
drEl.eventMousedownY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY;
drEl.minYpos =
$table.offset().top - originRecord.offset().top + $table.find('thead').outerHeight();
drEl.maxYpos = drEl.minYpos + $table.find('tbody').outerHeight() - originRecord.outerHeight();
$table.offset().top - originRecord.offset().top + $table.children('thead').outerHeight();
drEl.maxYpos = drEl.minYpos + $table.children('tbody').outerHeight() - originRecord.outerHeight();
$tableWrapper.append(recordNode);

if (isTouchDevice) {
Expand Down

0 comments on commit 2a9fa0e

Please sign in to comment.