Skip to content

Commit

Permalink
Fixed #8949 - Dynamic matrix: Focus next remove button or add button …
Browse files Browse the repository at this point in the history
…on removing a row (#8960)

* Fixed #8949 - Dynamic matrix: Focus next remove button or add button on removing a row

* Supported transposed matrix layout

* Implemented add row button auto focus after last row removed

* Added f-test for vertical matrix dynamic

* Fixed lint

* Updated snapshots

* Fixed f-tests

---------

Co-authored-by: tsv2013 <tsv2013@noreply.github.com>
  • Loading branch information
tsv2013 and tsv2013 authored Oct 24, 2024
1 parent e1888dc commit 45a1a41
Show file tree
Hide file tree
Showing 7 changed files with 1,249 additions and 1,120 deletions.
16 changes: 16 additions & 0 deletions packages/survey-core/src/question_matrixdropdownbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,22 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
public getRootCss(): string {
return new CssClassBuilder().append(super.getRootCss()).append(this.cssClasses.rootScroll, this.horizontalScroll).toString();
}
public afterRenderQuestionElement(el: HTMLElement): void {
super.afterRenderQuestionElement(el);
this.setRootElement(el?.parentElement);
}
public beforeDestroyQuestionElement(el: HTMLElement): void {
super.beforeDestroyQuestionElement(el);
this.setRootElement(undefined);
}

private rootElement: HTMLElement;
public setRootElement(val: HTMLElement): void {
this.rootElement = val;
}
public getRootElement(): HTMLElement {
return this.rootElement;
}
}

Serializer.addClass(
Expand Down
Loading

0 comments on commit 45a1a41

Please sign in to comment.