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

when changing the tabs in modal, the tab content comes from the page which is out of the modal #8435

Open
kjklhr opened this issue Mar 13, 2024 · 3 comments
Assignees

Comments

@kjklhr
Copy link

kjklhr commented Mar 13, 2024

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-que38s?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

click tab2

What is expected?

the tab content comes from the modal

What is actually happening?

the tab content comes from the page

Environment Info
ng-zorro-antd 17.3.0
Browser chrome 122.0.6261.112
@ParsaArvanehPA
Copy link
Contributor

Hi @kjklhr ,
I checked your sample, considering the way nz-tab works, such behavour is expected.
To avoid such a problem, I suggest you:
1- set a classname to your modal via nzClassName, because later you will use ::ng-deep to set some styles to it, and it is better to have a unique name when working with ng-deep
2- set the overflow value to hidden in your stylesheet

app.component.html

<nz-modal [(nzVisible)]="isVisible" nzTitle="The first Modal" [nzClassName]="'my-modal-wrapper'" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
    <ng-container *nzModalContent>
        <nz-tabset>
            <nz-tab nzTitle="Tab 1">Content of Tab Pane 1</nz-tab>
            <nz-tab nzTitle="Tab 2">Content of Tab Pane 2</nz-tab>
            <nz-tab nzTitle="Tab 3">Content of Tab Pane 3</nz-tab>
        </nz-tabset>
    </ng-container>
</nz-modal>

app.component.scss

::ng-deep {
    .my-modal-wrapper {
        overflow: hidden;
    }
}

@kjklhr
Copy link
Author

kjklhr commented Mar 15, 2024

@ParsaArvanehPA
it works totally fine in 17.2.0, so i think it is a bug, thanks anyway

@altso
Copy link

altso commented Mar 20, 2024

I believe it's caused by this change #8372. Agree with @kjklhr, it feels like a bug to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants