question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<nz-form-control> in <nz-form-item nzGutter> should generated correct padding

See original GitHub issue

Version

1.8.0

Environment

Windows 10 Chrome 70.0.3538.102(正式版本) (64 位) ng-zorro-antd@1.8.0

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start-z14eiy?file=src%2Fapp%2Fapp.component.html

Steps to reproduce

<nz-form-item nzGutter="8">
  <nz-form-control nzSpan="10">
    <nz-form-text>Col 10 In Form</nz-form-text>
  </nz-form-control>
</nz-form-item>

What is expected?

<nz-form-control> get correct style padding-left: 4px; padding-right: 4px, like [nz-col] in [nz-row].

What is actually happening?

<nz-form-control> has no style, but <nz-form-item> generated margin style.

Other?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
asincolecommented, Nov 20, 2018

Hi, so I have taken a look at it, I discovered that the nz-form-control selector has no padding added, so I have added that, but then once nzSpan directive is added, the padding rule gets overwritten and then set to 0 which are the rules for nzSpan directive. So I added an extra rule to override it

 .@{form-prefix-cls}-item-control-wrapper {
    display: block;
    width: 100%;
    padding-right: 4px; 
    padding-left: 4px;
    &[class^="@{ant-prefix}-col-"] { // adds the padding rules to overwrite the nzSpan directive rules
      padding-right: 4px;
      padding-left: 4px;
    }

is repeating the rules optimal or is there a better way I can do it?

1reaction
asincolecommented, Nov 26, 2018

@wendzhue alright. I’ll do it in a bit… sorry about the delay. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NG-ZORRO/ng-zorro-antd (Raised $277.00) - Issuehunt
<nz-form-control> in <nz-form-item nzGutter> should generated correct padding. Funded#2479created bywheeljs. $20.00. 使用OnPush策略的组件里,nz-modal关闭后 ...
Read more >
Form | NG-ZORRO - Ant Design
Used to separate the item in forms, contains label(optional) and control field. nz-form-label component #. The label of the form item, optional. nz-form-control...
Read more >
ng-zorro-antd | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Angular (forked) - StackBlitz
Created with <3 by the StackBlitz SDK! ... <div nz-row nzGutter="8">. <div nz-col nzSpan="12">. <nz-form-item> ... <nz-form-control>. <input nz-input.
Read more >
CHANGELOG.md · Gitee 极速下载/ng-zorro - Gitee.com
... grid: nzGutter support string type (#6450) (ec03c7f) ... tabs: fix the pagnation padding-right when scrolling (#3539) (#3709) (9a4df38) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found