feat(module:mention): support nzClear - #9377
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9377 +/- ##
==========================================
- Coverage 92.27% 92.23% -0.04%
==========================================
Files 560 560
Lines 19743 19759 +16
Branches 3029 3029
==========================================
+ Hits 18217 18224 +7
- Misses 1194 1203 +9
Partials 332 332 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@HyperLife1119 i have just updated the PR to avoid recreating the weel :) now it’s good :) thanks for your patience and review ! :) |
|
Oh no, can you undo it? I don't recommend using nz-select-clear here because it's not abstract enough :( |
Of course :) |
0036ce3 to
0a4cdab
Compare
@HyperLife1119 it’s revert :) |
a9eb65e to
db0fcd9
Compare
|
@HyperLife1119 could I merge it ? |
| } else { | ||
| this.elementRef.nativeElement.value = ''; | ||
| } | ||
| this.value.set(value || ''); |
There was a problem hiding this comment.
What if the user write a non-string value? There seems to be a different behavior with this PR
There was a problem hiding this comment.
But the type of value in the previous pr was a string. And it could be at the end only a string cause the directive is apply on an input or a text area so when we enter in the writeValue hook the value can only be a string or maybe I miss something in my reasoning ?
There was a problem hiding this comment.
The NzMentionTriggerDirective is deigned to used on an input or a textarea element, which value should be string you're right.
However, there is no type check with ngModel. for example:
@Component({
imports: [FormsModule, NzMentionTriggerDirective],
template: `
<nz-mention [nzSuggestions]="suggestions" (nzOnSelect)="onSelect($event)">
<textarea
rows="1"
placeholder="input here"
nzMentionTrigger
nz-input
[(ngModel)]="value"
(ngModelChange)="onChange($event)"
></textarea>
</nz-mention>
`
})
export class MentionTestComponent {
value = model<object>({});
}The result is
The previous result is
There was a problem hiding this comment.
Ohhh I totally missed the use case of NgModel, that's true. I will revert this change and then I think we will be good
|
@Laffery change are done, I revert to the previous behavior |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Mention component now support nzClear icon
Does this PR introduce a breaking change?
Other information