Repository navigation
fix(ui): RichTextEditor ignoriert veraltete Echos eigener Eingaben (0.9.1) - #26
Merged
Merged
Conversation
The outside-value sync called setContent whenever `value` differed from the editor's HTML. Own edits come back as `value` one render later; under load a keystroke lands before the sync effect runs, so the echo is already stale and reset the editor - dropping the newest keystroke and, for good, a trailing space. The editor now records the HTML it emits via onChange: an echo of a pending own emission is ignored, catching up with the newest emission clears the queue, and any other change of the prop is external and applied (also when it equals an earlier text, e.g. a form reset to ""). setContent still uses emitUpdate:false and addToHistory:false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
RichTextEditorübernahm jedenvalue, der vom Editor-HTML abwich. Kommt unter Last eine veraltete Kopie der eigenen letzten Eingabe zurück (asynchrone State-/Autosave-Runden), setzte sich der Editor darauf zurück – das zuletzt getippte Zeichen bzw. ein Leerzeichen am Ende ging verloren. Gefunden über schwankende E2E-Tests in Abstimmbar (virtUOS/abstimmbar#205, dort vorerst per Wrapper umgangen); Ausleihbar ist ebenso betroffen.Fix: Der Editor merkt sich, welche Werte er selbst per
onChangegemeldet hat.valuezurück → ignorieren.valuegilt als Änderung von außen und wird übernommen – auch wenn sie einem früheren Text gleicht (z. B. Formular auf "" zurücksetzen, Wechsel zu einem Datensatz mit gleichem Text).Version 0.9.1, CHANGELOG-Eintrag.
Geprüft in Abstimmbar mit nur diesem Fix (Wrapper entfernt, 0.9.1-Tarball): betroffene E2E-Specs 200/200 bei 10 Wiederholungen; Tippen, Fett, Undo/Redo, Speichern/Neuladen ok. Gegenprobe mit 0.9.0 schlägt fehl.
🤖 Generated with Claude Code