Skip to content

Commit

Permalink
Fix surveyjs/survey-creator#6405: fix animation keys for matrix rows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 authored and dmitry-kurmanov committed Jan 20, 2025
1 parent c9c3e7f commit 9928efb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/survey-core/src/question_matrixdropdownrendered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ export class QuestionMatrixDropdownRenderedTable extends Base {
},
getEnterOptions: (_, info) => {
return { cssClass: this.cssClasses.rowEnter, onBeforeRunAnimation, onAfterRunAnimation };
},
getKey: (item) => {
return item.id;
}
};
}
Expand Down
5 changes: 5 additions & 0 deletions packages/survey-core/tests/question_matrixdynamictests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10082,6 +10082,11 @@ QUnit.test("table: check animation options", function (assert) {
document.body.appendChild(tableHtmlElement);
questionHtmlElement.style.height = "20px";

assert.equal(renderedTable.rows[0].id, options.getKey(renderedTable.rows[0]));
assert.equal(renderedTable.rows[1].id, options.getKey(renderedTable.rows[1]));
assert.equal(renderedTable.rows[2].id, options.getKey(renderedTable.rows[2]));
assert.equal(renderedTable.rows[3].id, options.getKey(renderedTable.rows[3]));

const enterOptions = options.getEnterOptions(renderedTable.rows[1]);
enterOptions.onBeforeRunAnimation && enterOptions.onBeforeRunAnimation(rowHtmlElement);
assert.equal(enterOptions.cssClass, "enter");
Expand Down

0 comments on commit 9928efb

Please sign in to comment.