Closed AbhishekKS closed 3 years ago
@AbhishekKS thank you for reporting this. We will take a look.
Thank you, Andrew
@tsv2013 for selectbase I have added canShowOptionItemCallback
question.canShowOptionItemCallback = (item: ItemValue): boolean => {
return !creator.isReadOnly && (item.value !== "newitem"
|| question.choices.length < options.maximumChoicesCount);
};
@tsv2013 I have implemented the code for choices adorners.
Thank you, Andrew
I've implemented main part of the read only mode support. If you find other issues, please open a separate thread.
Are you requesting a feature, reporting a bug or ask a question?
Bug
What is the current behavior?
In React V2, on setting creator.readOnly=true; some actions are still allowed on designer page. 1) String editor controls for Survey Title, Survey Desc, Page Title, Page Desc, Choices, etc are editable. 2) On selecting a question type from the Question button selector on the page, the question button text is changed to the selected question type. Though the question is not added, should we stop changing the question button text? 3) Drag-drop question from toolbox creates a new page and adds a question. 4) Clicking on Add Question button on a new page, creates an empty page without any question.
There could be other actions also which I could be missing now.
What is the expected behavior?
No actions should be allowed to be performed if the survey is marked as readonly.
How would you reproduce the current behavior (if this is a bug)?
Can be reproduced here: https://plnkr.co/edit/iQ45FsWZcmFsD3H1
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://plnkr.co/edit/iQ45FsWZcmFsD3H1
Test code var creator = new SurveyCreator.SurveyCreator(options); creator.JSON = json; creator.readOnly = true;
Specify your