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.
What is the purpose of this pull request?
Overview of changes:
Fixes #2566
To fix the skew of the initial positioning of the dropdown-menu, changes the use of
d-none
(display:none !important
) which removes the element from the DOM tovisibility:hidden
which instead allows it to persist in DOM even when hidden, such that the dropdown menu position does not get skewed.Anything you'd like to highlight/discuss:
Another solution I came up with was to add a
div
container with relative positioning as a parent to thedropdown-menu
, as such:It could be due to the way Popper.js works, as it helps to retain the DOM structure as if the
dropdown-menu
was there even when it is removed due todisplay:none
. However, I thought it might be a hacky solution that could cause confusion later on, making it less ideal, although less invasive and perhaps worth considering.Testing instructions:
Test as per #2566:
Proposed commit message: (wrap lines at 72 characters)
Fix Searchbar dropdown-menu positioning
Fix initial dropdown-menu positioning by replacing
d-none
with
visibility:hidden
. Popper.js cannot calculate the position ofelements removed from the DOM with
display: none
. Let'sreplace
d-none
withvisibility:hidden
, keeping the elementin the DOM, allowing Popper.js to correctly calculate its position.
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major
,r.Minor
,r.Patch
.Breaking change release note preparation (if applicable):