Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Filter Field Autocomplete Panel appears above page header #1747

Closed
anntr opened this issue Oct 19, 2020 · 2 comments · Fixed by #1757
Closed

Filter Field Autocomplete Panel appears above page header #1747

anntr opened this issue Oct 19, 2020 · 2 comments · Fixed by #1757
Assignees
Labels
bug A broken behaviour that was working previously

Comments

@anntr
Copy link
Contributor

anntr commented Oct 19, 2020

Bug Report

Expected Behavior

autocomplete panel should not overlay sticky header

Current Behavior

autocomplete panel overlays sticky header

Steps to Reproduce

https://stackblitz.com/edit/github-denej4?file=src/app/app.component.html

  1. Expand the panel by click in Filter by input
  2. With panel expanded, scroll up

Context (Environment)

I can see in Stackblitz that the dt-autocomplete-panel is rendered inside cdk-overlay-container, cdk-overlay-container is rendered outside the app root and has z-index: 1000 thus covering everything.

Exactly same issue was reported and fixed in #451.

Is Stackblitz example valid and something might have broken in Barista after #451 fix?
Do I miss something in the Stackblitz example that would make the dt-autocomplete-panel overlay respect fixed header positioning?

Used Versions:

  • angular: 10.1.6
  • @angular/cdk: 10.2.5
  • @dynatrace/barista-components: 8.1.2
@anntr anntr added the bug A broken behaviour that was working previously label Oct 19, 2020
@anntr
Copy link
Contributor Author

anntr commented Oct 21, 2020

I tried to investigate the issue and prepare a fix. I hope that you can push me in the right direction.

I've noticed that the Strategy used for popup positioning is relying only on viewport position, unaware of any sticky elements positioning. I've tried to use DtViewportResizer instead of ViewportRuler as their interfaces are very similar. I had created StickyHeaderAwareViewport which updates its offset top position after the header renders and injected it instead of DtViewportResizer.
Positioning Strategy is now aware of the header offset, treats my own injected viewport as the actual viewport but still closes the popup only when part of it is outside the browser visible area. I suspect that there might be a problem with getOverlayFit() as isCompletelyWithinViewport is true when it touches the header but should be false.

Is this own viewport implementation idea the right approach here?
This bug is getting urgent, we have several tickets regarding this issue from different teams and I'd like to help to fix this in Barista.

@ffriedl89
Copy link
Collaborator

@anntr Thx for helping out with the investigation. I've done a deeper dive just right now to figure out what is going on. The issue that I see is that the filter field / autocomplete does not set the viewportMargin on the DtFlexibleConnectedPositionStrategy. Therefore the viewport margin is always 0 since we default back to it. It should be enough to do the same thing as in the selection-area.
If we take the viewportResizers offset stream and provide the values to the positionstrategy similar to the selection-area, the viewport margin should be taken into account. I'll try to get a fix done since this is quite urgent and I am already quite deep down the rabbit hole.

@ffriedl89 ffriedl89 self-assigned this Oct 22, 2020
ffriedl89 added a commit that referenced this issue Oct 22, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
ffriedl89 added a commit that referenced this issue Oct 22, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
ffriedl89 added a commit that referenced this issue Oct 23, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
ffriedl89 added a commit that referenced this issue Oct 28, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
ffriedl89 added a commit that referenced this issue Oct 28, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
ffriedl89 added a commit that referenced this issue Oct 28, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
ffriedl89 added a commit that referenced this issue Oct 28, 2020
…ot react to viewport boundaries correctly.

Closes #1747.
yngrdyn pushed a commit to yngrdyn/barista that referenced this issue Nov 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A broken behaviour that was working previously
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants