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

feat(module:input): textarea supports character count #6104

Merged
merged 1 commit into from Dec 1, 2020

Conversation

yangjunhan
Copy link
Contributor

close #5907

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #5907

What is the new behavior?

It now supports displaying character count at the bottom-right corner below the textarea. User can customize max length and character count computation function.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@zorro-bot
Copy link

zorro-bot bot commented Nov 26, 2020

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Nov 26, 2020

Codecov Report

Merging #6104 (8ab5043) into master (7ef2ed0) will decrease coverage by 0.03%.
The diff coverage is 84.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6104      +/-   ##
==========================================
- Coverage   89.86%   89.82%   -0.04%     
==========================================
  Files         467      468       +1     
  Lines       14214    14238      +24     
  Branches     2238     2238              
==========================================
+ Hits        12773    12789      +16     
- Misses        890      893       +3     
- Partials      551      556       +5     
Impacted Files Coverage Δ
components/input/input.module.ts 100.00% <ø> (ø)
components/input/textarea-count.component.ts 84.00% <84.00%> (ø)
components/core/util/text-measure.ts 89.56% <0.00%> (-1.74%) ⬇️
components/tabs/tab-nav-bar.component.ts 81.62% <0.00%> (-0.71%) ⬇️
components/tree/tree-indent.component.ts 100.00% <0.00%> (ø)
components/tree/tree-node.component.ts 91.07% <0.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ef2ed0...8ab5043. Read the comment docs.

changeDetection: ChangeDetectionStrategy.OnPush
})
export class NzTextareaCountComponent implements AfterContentInit, OnDestroy {
@ContentChild(NzInputDirective, { static: true }) nzInputDirective!: NzInputDirective;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be static: true, does it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx review, dynamic content will make matching targets more complex, in which case I think it's enough for developers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static flag isn't about dynamic content, it's about lifecycle, and static true is deprecated so it has to be removed anyway. In here it can be removed without any additional effort.

@yangjunhan yangjunhan force-pushed the textarea-wordcount branch 4 times, most recently from 97e4700 to 0575781 Compare December 1, 2020 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Input] text-area support value count
4 participants