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

Cant change width of nz-date-picker #1614

Closed
chichujn opened this issue Jun 7, 2018 · 7 comments · Fixed by #4843
Closed

Cant change width of nz-date-picker #1614

chichujn opened this issue Jun 7, 2018 · 7 comments · Fixed by #4843

Comments

@chichujn
Copy link

chichujn commented Jun 7, 2018

Version

0.7.1

Environment

Windows 10 64bit, Chrome 66, ng-zorro 0.7.1

Reproduction link

https://ng-zorro-antd-setup-zkxsjw.stackblitz.io

Steps to reproduce

Change width of nz-date-picker to 100%

What is expected?

nz-date-picker should stretch to fill parent width, like nz-input-number and nz-select etc.

What is actually happening?

nz-date-picker keep a fixed width, 174px in test

Other?

@vthinkxie
Copy link
Member

vthinkxie commented Jun 7, 2018

https://stackblitz.com/edit/ng-zorro-antd-setup-tuv9km?file=app/app.component.css
The html element of nz-date-picker is not the same as antd react version.
@wilsoncook

@wilsoncook
Copy link
Member

The behavior is the same with antd, it is not follow the ancestor's width except you set width:100% to nz-date-picker, see antd below:
image

@vthinkxie
Copy link
Member

@wilsoncook the wrapper div should not exist at all.

@IonelLupu
Copy link

@vthinkxie any updates on this? Currently I am manually changing the width of the datepicker like this:

nz-date-picker{
    width: 100%;
    nz-picker{
        width: 100%;
        display: inline-block;
        .ant-calendar-picker{
            width: 100%;
        }
    }
}

@Xambey
Copy link

Xambey commented Mar 2, 2020

+same problem

@vthinkxie
Copy link
Member

cc @wenqi73

@phoenix503
Copy link

@vthinkxie any updates on this? Currently I am manually changing the width of the datepicker like this:

nz-date-picker{
    width: 100%;
    nz-picker{
        width: 100%;
        display: inline-block;
        .ant-calendar-picker{
            width: 100%;
        }
    }
}

It is not working for me?

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