Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: session - dropdown/menu opened in header are not closed when user is logged out #1570

Closed
SuperITMan opened this issue Jan 22, 2020 · 1 comment · Fixed by #1761
Closed
Assignees
Milestone

Comments

@SuperITMan
Copy link
Member

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

When the session is closed by the StarkSession service, it redirects to the session-logout page.
Unfortunately, if the user opened the language selector before being logged out, it stays opened.

image

Expected behavior

The dropdown should be closed when the user is redirected to the session-logout page.

Minimal reproduction of the problem with instructions

Open the language-selector and wait until you are logged out automatically.

What is the motivation / use case for changing the behavior?

Bug fixing.

Environment


Angular version: 7.x
Stark version: 10.0.0-rc.3


@SuperITMan SuperITMan added this to the 10.0.0 milestone Jan 22, 2020
@christophercr christophercr self-assigned this Jan 28, 2020
@SuperITMan SuperITMan modified the milestones: 10.0.0, 10.0.1 Mar 10, 2020
@christophercr christophercr modified the milestones: 10.0.1, 10.1.0 Mar 19, 2020
christophercr added a commit to christophercr/stark that referenced this issue Mar 21, 2020
…layContainer when navigating to the SessionExpired state

ISSUES CLOSED: NationalBankBelgium#1570
christophercr added a commit to christophercr/stark that referenced this issue Mar 21, 2020
…layContainer when navigating to the SessionExpired state

ISSUES CLOSED: NationalBankBelgium#1570
christophercr added a commit to christophercr/stark that referenced this issue Mar 23, 2020
…layContainer when navigating to the SessionExpired state

ISSUES CLOSED: NationalBankBelgium#1570
christophercr added a commit to christophercr/stark that referenced this issue Mar 23, 2020
…layContainer when navigating to the SessionExpired state

ISSUES CLOSED: NationalBankBelgium#1570
@christophercr
Copy link
Collaborator

christophercr commented Mar 24, 2020

After investigating the issue, it turns out the cause of the problem is that any Angular Material element that creates an overlay, such as the mat-select inside the StarkDropdown component, is embedded in an OverlayContainer and this container is not placed inside the app component but at the root of the page.

Therefore, when the view is destroyed by the router when navigating to the SessionExpiredPage, the container remains there with the overlays that it had at the moment (open or closed):

Screenshot 2020-03-24 at 10 43 12

So, the solution would be then to destroy such OverlayContainer when navigating to any of the exit states: SessionExpired and SessionLogout. This can be done by calling its ngOnDestroy method.

christophercr added a commit to christophercr/stark that referenced this issue Mar 24, 2020
…layContainer when navigating to an 'exit' state

ISSUES CLOSED: NationalBankBelgium#1570
@christophercr christophercr changed the title core: session - dropdown/menu opened in header are not closed when user is logged out ui: session - dropdown/menu opened in header are not closed when user is logged out Mar 24, 2020
christophercr added a commit to christophercr/stark that referenced this issue Mar 25, 2020
…layContainer when navigating to an 'exit' state

ISSUES CLOSED: NationalBankBelgium#1570
christophercr added a commit to christophercr/stark that referenced this issue Mar 27, 2020
…layContainer when navigating to an 'exit' state

ISSUES CLOSED: NationalBankBelgium#1570
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment