Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object inside array with readOnly true is not showing as disabled with material cells #2384

Open
neosri opened this issue Oct 28, 2024 · 1 comment

Comments

@neosri
Copy link

neosri commented Oct 28, 2024

Describe the bug

Object inside array with readOnly true is not showing as disabled with material cells.

Expected behavior

Objects defined inside of an array in JsonSchema with a property having a readOnly keyword set to true should render the property/control as disabled.

Steps to reproduce the issue

  1. define a JsonSchema as shown below
const schema =  {
	type: 'array',
	title: 'test',
	description: 'connection ',
	items: {
		type: 'object',
		title: 'test',
		description: 'test',
		properties: {
			ipAddress: {
				readOnly:true,
				type: 'string'							
			},
			port: {
				readOnly:true,
				type: 'number'							
			}						
		},
		required: ['ipAddress']
	}
}
  1. Create a Jsonforms component and pass the jsonschema defined above, UI Schema is not relevant here. We are using the material cells and material renderers.
  2. The ipAddress and port properties defined above with readOnly true would be still editable.

Screenshots

No response

Which Version of JSON Forms are you using?

latest

Package

React Material Renderers

Additional context

No response

@lucas-koehler
Copy link
Contributor

Thanks for the report! I edited the issue inline to format your example schema.
For reference. This issue is based on this discussion.

There it was discovered that cell renderers currently always get true as their enabled state and that this is most likely caused here.

@lucas-koehler lucas-koehler added this to the 4.x milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants