ngx-render-material-forms 2.5.20 → 2.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4953,6 +4953,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
4953
4953
  </ng-template>
4954
4954
  `, styles: [".datagrid-row{height:auto}.mat-table{width:100%}.mat-header-cell,.mat-cell{padding:8px}.no-data-message{display:flex;justify-content:center;align-items:center;text-align:center;padding:20px;margin:0 20px;font-size:18px;color:#888}::ng-deep .picker2new-btn.cdk-program-focused .mat-button-focus-overlay{opacity:0}\n"] }]
4955
4955
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$1.MatDialog }, { type: CommonService }]; } });
4956
+ // Material components have no formio `.element`, and older formiojs versions call
4957
+ // element.querySelectorAll() here without a null check after addRow().
4958
+ DataGridComponent.prototype.focusOnNewRowElement = function (row) {
4959
+ Object.keys(row || {}).find((key) => {
4960
+ const element = row[key]?.element;
4961
+ const focusableElements = element?.querySelectorAll?.('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href]');
4962
+ if (focusableElements && focusableElements[0]) {
4963
+ focusableElements[0].focus();
4964
+ return true;
4965
+ }
4966
+ return false;
4967
+ });
4968
+ };
4956
4969
  DataGridComponent.MaterialComponent = MaterialDataGridComponent;
4957
4970
 
4958
4971
  var EditRowState;