added autobind back so there are as less changes as possible in the PR

This commit is contained in:
Alice Rosa 2022-09-06 05:22:23 +03:00
parent 4cc204b64a
commit a40f101b50
1 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import * as React from 'react';
import { autobind } from 'office-ui-fabric-react/lib/Utilities';
import { IFieldConfiguration } from './IFieldConfiguration';
import { IListFormProps } from './IListFormProps';
import { IListFormState } from './IListFormState';
@ -232,7 +233,8 @@ class ListForm extends React.Component<IListFormProps, IListFormState> {
}
}
private readSchema = async (listUrl: string, formType: ControlMode): Promise<void> => {
@autobind
private async readSchema(listUrl: string, formType: ControlMode): Promise<void> {
try {
if (!listUrl) {
this.setState({ ...this.state, isLoadingSchema: false, fieldsSchema: null, errors: [strings.ConfigureListMessage] });
@ -291,7 +293,8 @@ class ListForm extends React.Component<IListFormProps, IListFormState> {
}
}
private readData = async (listUrl: string, formType: ControlMode, id?: number): Promise<void> => {
@autobind
private async readData(listUrl: string, formType: ControlMode, id?: number): Promise<void> {
try {
if ((formType === ControlMode.New) || !id) {
const data = this.state.fieldsSchema
@ -330,7 +333,8 @@ class ListForm extends React.Component<IListFormProps, IListFormState> {
}
}
private valueChanged = async (fieldName: string, newValue: any) => {
@autobind
private async valueChanged(fieldName: string, newValue: any) {
let schema = this.state.fieldsSchema.filter((item) => item.InternalName === fieldName)[0];
if (schema.Type == "User" || schema.Type === "UserMulti") {
for (let i = 0; i < newValue.length; i++) {