Remove random key from comment field #4177
Merged
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.
Description
Removes the wait introduced in #4176
CommentField
s were set to have a random key (why I do not know), that would make it re-render excessively (and thus clear the focus and content of the new comment). This removes the key, and rather handles form resetting by using theform.change()
method.Changes done to
TextInput.ts
were done to avoid bugs that were discovered while trying another approach.inputRef
was used as a parameter inuseRef()
, it did not updateinputRef
whennewInputRef
was used. Thus it was not possible to pass a ref through to the component.Result
When run on my machine this works quite well, and I can start writing comments before all the content of the page has been loaded - which was not the case previously.
To see if this resolves the cypress-bug, we'll probably have to wait and see. This passed cypress on the first attempt, but lately it has worked some times and some times not, so it's no guarantee.
Testing
Have been testing that the comment form works as expected in the event view.