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

fix: When schema is readonly, input is disabled and readonly. #831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prespic
Copy link

@prespic prespic commented Oct 8, 2020

problem: [readonly] and [disabled] attributes should be applied, but only readonly si applied on buld. disabled attribute is applied after show-hide property editor.

Q A
Is bugfix? ✔️
New feature?
Breaks backward-compatibility?
Tests pass? ✔️
Fixed issues comma-separated list of tickets # fixed by the PR, if any
Updated README/docs?
Added CHANGELOG entry?

problem: [readonly] and [disabled] attributes should be applied, but only readonly si applied on buld. disabled attribute is applied after show-hide property editor.
@schmunk42
Copy link
Collaborator

Some tests for "read-only" do not pass: https://travis-ci.com/github/json-editor/json-editor/jobs/396794375

schmunk42 added a commit that referenced this pull request Mar 9, 2021
@ccancellieri
Copy link
Contributor

ccancellieri commented Aug 30, 2021

Dear @schmunk42 @prespic
EDITed

I'm not sure I've understood:

when the editor is 'readonly' the fields should be marked as readonly but absolutely not to disabled and vice versa.

Actually this part of the documentation is a bit unclear:
https://github.com/json-editor/json-editor#enable-and-disable-the-editor

In a form if you disable a field it will not be sent to the server on post, if you mark it as read-only it will...

Do we have a separated read-only feature for the editor?

thanks

@schmunk42
Copy link
Collaborator

schmunk42 commented Sep 1, 2021

It should work as you described, as far as I can see.

AFAIK there's no editor.setReadOnly() or similar at the moment. CC: @germanbisurgi ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants