Increase textarea debounce time for custom markup
This commit is contained in:
parent
eba2a7a834
commit
6a056bbe4d
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<my-markdown-textarea
|
<my-markdown-textarea
|
||||||
name="instanceCustomHomepageContent" formControlName="content"
|
name="instanceCustomHomepageContent" formControlName="content"
|
||||||
[customMarkdownRenderer]="getCustomMarkdownRenderer()"
|
[customMarkdownRenderer]="getCustomMarkdownRenderer()" [debounceTime]="500"
|
||||||
[formError]="formErrors['instanceCustomHomepage.content']"
|
[formError]="formErrors['instanceCustomHomepage.content']"
|
||||||
></my-markdown-textarea>
|
></my-markdown-textarea>
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
<my-markdown-textarea
|
<my-markdown-textarea
|
||||||
name="instanceDescription" formControlName="description"
|
name="instanceDescription" formControlName="description"
|
||||||
[customMarkdownRenderer]="getCustomMarkdownRenderer()"
|
[customMarkdownRenderer]="getCustomMarkdownRenderer()" [debounceTime]="500"
|
||||||
[formError]="formErrors['instance.description']"
|
[formError]="formErrors['instance.description']"
|
||||||
></my-markdown-textarea>
|
></my-markdown-textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,6 +31,8 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
|
||||||
@Input() markdownType: 'text' | 'enhanced' = 'text'
|
@Input() markdownType: 'text' | 'enhanced' = 'text'
|
||||||
@Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement>
|
@Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement>
|
||||||
|
|
||||||
|
@Input() debounceTime = 150
|
||||||
|
|
||||||
@Input() markdownVideo: Video
|
@Input() markdownVideo: Video
|
||||||
|
|
||||||
@Input() name = 'description'
|
@Input() name = 'description'
|
||||||
|
@ -59,7 +61,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.contentChanged
|
this.contentChanged
|
||||||
.pipe(
|
.pipe(
|
||||||
debounceTime(150),
|
debounceTime(this.debounceTime),
|
||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
)
|
)
|
||||||
.subscribe(() => this.updatePreviews())
|
.subscribe(() => this.updatePreviews())
|
||||||
|
|
Loading…
Reference in New Issue