-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(modals): add support for nested modals (fix scroll) #1987
feat(modals): add support for nested modals (fix scroll) #1987
Conversation
Twitter bootstrap (and so ngx-boostrap) doesn't officialy support nested modals. You can however display nested modal but at least one issue appears: At first modal you close, scroll events and scrollbar go back to the page, so you can't scroll modals that are still displayed. I propose to improve it with following modifications in modal component: - at show, check if 'modal open' class is already attached to document body and set `isNested` boolean accordingly - at hide, if nested, do not remove 'modal open' class and do not reset scrollbar. Related to: #896 #1691
Codecov Report
@@ Coverage Diff @@
## development #1987 +/- ##
==============================================
+ Coverage 85.93% 86.64% +0.7%
==============================================
Files 78 77 -1
Lines 2098 2067 -31
Branches 273 270 -3
==============================================
- Hits 1803 1791 -12
+ Misses 202 183 -19
Partials 93 93
Continue to review full report at Codecov.
|
Hi, what's the status on this? It fixes the scroll problem on my project; I'd love to see it merged! |
@IlyaSurmay Thanks for the documentation ! |
Сlicking on exit button on third modal window closes second modal window and makes third modal window inactive. |
Closing nested modals fixed. It looks good now |
merged |
I need to sit and give time to creating a proper bug report, but for now here's a quick note for anyone coming here via search like me: This PR might have introduced a bug where calling The current workaround I added to my application is adding another directive with the same selector as the modal component, that disables animation on the component itself so that all the logic is run synchronously. Something like: @Directive({
selector: '[bsModal]'
})
export class BsModalOverrideDirective {
constructor(private modal: ModalComponent) {
modal.isAnimated = false;
}
} P.S. Thanks heaps for all the great work on this awesome library. |
@Meligy I hope to drop ng v2 support soon and move to ng v4.2 |
BTW we are almost done with ModalService |
Twitter bootstrap (and so ngx-boostrap) doesn't officialy support nested modals.
You can however display nested modal but at least one issue appears:
At first modal you close, scroll events and scrollbar go back to the page, so
you can't scroll modals that are still displayed.
I propose to improve it with following modifications in modal component:
set
isNested
boolean accordinglyscrollbar.
Related to:
#896
#1691