scania / corporate-ui

This repo will be archived in Q3 2021, please visit https://github.com/scania-digital-design-system
https://digitaldesign.scania.com/
25 stars 15 forks source link

Bug - Modal graybackground stays on DOM #537

Closed gabrielgirodo closed 4 years ago

gabrielgirodo commented 4 years ago

Describe the bug
Modal gray background remains on the application when we press the browser's back button

To Reproduce
Steps to reproduce the behavior:
Once the user triggers a popup we see the modal and its gray background which prevents the user from clicking on the other stuff outside the modal. However if the user clicks on the browser's back arrow the application navigates to the previous page but the gray background is kept on the page.

Expected behavior
Modal gray background be gone when navigating through pages

Version of Corporate-ui
3.5.3

Framework and version
If you use any specific framework please provide information

Application link
Provide link if possible

Desktop information:
Please complete the following information

mmexvr commented 4 years ago

Hello, nice that you reported it! :)

Can you please follow this structure of creating a issue. You can just copy paste the markdown

https://github.com/scania/corporate-ui/issues/new?assignees=&labels=bug&template=bug_report.md&title=Bug+-+%22title+text%22

helloimela commented 4 years ago

This issue apparently appeared when using bootstrap modal in SPA both in corporate-ui 3 and 4. The fixes can be done from corporate-ui side or project side. From project side, it could be like this: everytime navigation occurred, hide bootstrap modal backdrop $('.modal-backdrop').remove();

Do you think it should be implemented as a solution from corporate-ui? It can be tricky from corporate-ui script, because we need to access the DOM and it could be different from one project to another. One possible solution is to add it to c-modal component.

Interesting discussion: https://stackoverflow.com/questions/11519660/twitter-bootstrap-modal-backdrop-doesnt-disappear

Please give us update if you have found a solution so far @gabrielgirodo ! Thanks! :)

helloimela commented 4 years ago

A month ago we announced about deprecation of Corporate UI 3 in 1 year, we will only provide support for severe bugs. We will close this issue for now. Please check solution in Corporate UI 4 and if the problem appears, we will solve it in version 4.

helloimela commented 4 years ago

Link to announcement in Teams: link