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

affix: should be reset placeholder size when trigger resize event #2818

Closed
cipchk opened this issue Jan 22, 2019 · 1 comment · Fixed by #2835
Closed

affix: should be reset placeholder size when trigger resize event #2818

cipchk opened this issue Jan 22, 2019 · 1 comment · Fixed by #2835
Assignees

Comments

@cipchk
Copy link
Member

cipchk commented Jan 22, 2019

Related

#2789

@cipchk cipchk self-assigned this Jan 22, 2019
vthinkxie pushed a commit that referenced this issue Feb 12, 2019
…ize event (#2835)

* fix(module:affix): fix should reset placeholder size when trigger resize event

- close #2818

* chore: fix test
@zd5043039119
Copy link
Contributor

@cipchk when you reset placeholder size when trigger resize, you will lost placeholder's height

  if (e.type === 'resize') {
      this.syncPlaceholderStyle(e);
    }
 private syncPlaceholderStyle(e: Event): void {
    if (!this.affixStyle) {
      return ;
    }
    this.placeholderNode.style.cssText = '';
    const widthObj = { width: this.placeholderNode.offsetWidth };
    this.setAffixStyle(e, {
      ...this.affixStyle,
      ...widthObj
    });
    this.setPlaceholderStyle(widthObj);
  }

in function "syncPlaceholderStyle", you clear the style of "placeholderNode" and then only set width of the node, then will lost the height, please fix it

Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this issue Apr 9, 2020
…ize event (NG-ZORRO#2835)

* fix(module:affix): fix should reset placeholder size when trigger resize event

- close NG-ZORRO#2818

* chore: fix test
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
…ize event (NG-ZORRO#2835)

* fix(module:affix): fix should reset placeholder size when trigger resize event

- close NG-ZORRO#2818

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

Successfully merging a pull request may close this issue.

3 participants