(fix) Fix ng-select dropdown position #108
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
Summary
I've fixed an issue with the placement of the dropdown element when using
ng-select
elements in the form engine. More specifically, theng-select
element gets used when the chosen rendering type for a field is multiCheckbox. In theng-select
configuration, you can choose to provide a string value to theappendTo
input.appendTo
allows you to append the dropdown to the body of your document or any other element using a CSS selector.Presently, the dropdown's
appendTo
input is set toform
, which means the dropdown gets appended to the form element. This results in the dropdown getting rendered in the wrong position. In this PR, I've amended theappendTo
input's value to point to theid
of the ng-select element that renders the dropdown.Appending the dropdown to the
form
tag was originally intended to fix an issue where the dropdown would get cut off if the field occurred at the end of the page. This should no longer be an issue because the default value for the element'sdropdownPosition
input isauto
, which means that the browser will know whether to render the dropdown above or below the field based on its positioning.Screenshots
improper-dropdown-position.mp4
ng-select-dropdown-fix.mp4
Related Issue
https://issues.openmrs.org/browse/O3-2589
Other
@elimm's PR
@ng-select/ng-select README