Azure / fabric-react-jsonschema-form

8 stars 7 forks source link

Read-only fields shows as editable #3

Open YingXue opened 5 years ago

YingXue commented 5 years ago

I added this plug in, and found the read-only fields shows as editable. Definition of uiSchema and Form:

            const uiSchema = {
                'ui:readonly': true,
            };
            <Form
                schema={propertySchema as any} // tslint:disable-line:no-any
                formData={formData}
                showErrorList={false}
                uiSchema={uiSchema}
                widgets={allWidgets}
                {...fabricFields}
            >

Is it currently supported?

Before adding the plugin: image After adding the plugin: image

YingXue commented 5 years ago

I think I've found the problem. Currently the widgets only checks if the props are disabled or not. After change the uiSchema to 'ui:disable': true, it starts to work. Please kindly consider adding readonly as an option :)

billytrend commented 5 years ago

Hey @YingXue , sorry I missed these comments! I notice you have some fixes in your fork. I'd be happy to accept a PR if they work :). Otherwise I will add readonly option soon