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.19k stars 808 forks source link

Dropdown: A pop-up window is positioned incorrectly #6477

Closed Johoseph closed 1 year ago

Johoseph commented 1 year ago

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

Reporting a bug

What is the current behavior?

In v1.9.94, when opening a dropdown question in a Survey that lives within a modal (Reakit Dialog component in this case), the popup position does not align with the dropdown field.

image

What is the expected behavior?

In v1.9.93, when performing the same action as above, the popup position is correct.

image

I am unsure if this behaviour is specifically related to the interaction with the Reakit Dialog component I am using, or generally to all React portal components. I am curious what has changed between patch versions to cause this.

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

Using the below test sandbox, click 'open' to open a Survey in a Reakit Dialog component. Open the dropdown question to see the list popup misaligned with the question.

In package.json, decrement the SurveyJS version to 1.9.93 and repeat the above - the popup is correctly aligned with the question.

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

Test code/page URL: https://codesandbox.io/s/priceless-jasper-y49kdf

Specify your

andrewtelnov commented 1 year ago

@Johoseph Thank you for providing the reproduciable example. We will work on the fix. We render popup in survey div instead of root body in the latest versions. We need it for Theme support.

Thank you, Andrew