Try to prevent title debounce overwriting

This commit is contained in:
Michael Shamoon 2023-01-25 10:53:08 -08:00
parent a2e168f573
commit ad7c594dab

View File

@ -204,6 +204,10 @@ export class DocumentDetailComponent
)
.subscribe({
next: (titleValue) => {
// In the rare case when the field changed just after debounced event was fired.
// We dont want to overwrite whats actually in the text field, so just return
if (titleValue !== this.titleInput.value) return
this.title = titleValue
this.documentForm.patchValue({ title: titleValue })
},