surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.13k stars 804 forks source link

Dropdown question type not showing when used in Display mode #2594

Closed zhitomir-oreshenski-mm closed 11 months ago

zhitomir-oreshenski-mm commented 3 years ago

Are you requesting a feature, reporting a bug or asking a question?

Reporting a bug

What is the current behavior?

Dropdown question type not showing in SurveyJS display mode

What is the expected behavior?

Showing disabled dropdown/select

How would you reproduce the current behavior (if this is a bug)?

Using SurveyJs creator everything is working as expected

JSON:

{ "pages": [ { "name": "page1", "elements": [ { "type": "dropdown", "name": "3118", "title": "TestDropDown", "choices": [ { "value": "5330", "text": "1" }, { "value": "5331", "text": "2" } ] }, { "type": "text", "name": "3120", "title": "TestOpenEnded Bug" } ], "title": "Test" } ] }

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://surveyjs.io/create-survey

Test code

your_code_here

Specify your

andrewtelnov commented 3 years ago

@zhitomir-oreshenski-mm Could you please fork this example and reproduce the issue?

Thank you, Andrew

zhitomir-oreshenski-mm commented 3 years ago

Hi @andrewtelnov,

I've tried using the same code as above:

const mock = { showCompletedPage: false, mode: 'display', pages: [ { title: 'Test', name: 'page1', elements: [ { type: 'dropdown', name: 'car', title: 'What car are you driving?', isRequired: true, colCount: 0, choices: [ 'None', 'Ford', 'Vauxhall', 'Volkswagen', 'Nissan', 'Audi', 'Mercedes-Benz', 'BMW', 'Peugeot', 'Toyota', 'Citroen', ], }, ], }, ], };

I can see the title of the question but the dropdown element seems to be disabled and hidden.

Screenshot 2020-12-30 at 21 52 00

Best regards, Zhitomir

zhitomir-oreshenski-mm commented 3 years ago

In addition to this, if I remove the display mode everything seems to be working properly:

Reference:

Screenshot 2020-12-30 at 21 55 40

andrewtelnov commented 3 years ago

@zhitomir-oreshenski-mm As I wrote early, I do not see the issue your have. Here is the updated example. If we have this issue, we would have tons of messages from different users. "display" mode is a popular functionality and "dropdown" used in the most surveys. I guess the issue with your css or old survey libraries. Please try to reproduce the issue in example I gave you or create your own plunker example. It doesn't help posting your images here. Unless we could not reproduce the issue on our site, we can't help and fix the issue.

Thank you, Andrew

zhitomir-oreshenski-mm commented 3 years ago

Hi andrewtelnov,

Thank you for your response.

Yes, it's correct. When I tried outside of my project to reproduce the issue I cannot and it is working. Strangely, it is still not showing neither by updating the library to the latest version nor by removing completely my custom css. The dropdown can be seen only when display mode is off.

Any suggestions? Thank you in advance!

Br, Zhitomir

zhitomir-oreshenski-mm commented 3 years ago

Hi,

I do not think that this issue is a question, it seems to me that it is a bug, because the element being rendered is a div with a class="sv_q_dropdown_control" instead 'sv-dropdown'. Because there is not default value it is rendered as an empty div element.

Br, Zhitomir

andrewtelnov commented 3 years ago

@zhitomir-oreshenski-mm Could you please update the example to show the issue? We can't go futher until we do not reproduce it on our side.

Thank you, Andrew