Fixes #5850 performance issue request body editor #5882
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.
Delay setting content from request body into the global state until the text area loses focus otherwise the entire ui will render on every key press causing significant user pain when trying to enter values.
Description
Moved the global state changing call from the "onChange" event to the "onBlur" event for the textarea. This has the effect that the full state change does not take affect until the user clicks outside the text area, for example on the execute button to send the payload.
I do have a concerned that the "onBlur" event might trigger to late in some cases but I don't have enough experience or knowledge to say that for sure. I have not been able to find any issues during manual testing.
Motivation and Context
Fixes #5850
#5850
For large OpenAPI 3 documents the full render of all operations can be very expensive and slows down the users input so the visual input can lag very far behind what the user is typing. This makes it difficult to use the ui to edit and test sample payloads.
How Has This Been Tested?
This has been manually tested in Safari and Chrome on multiple machines. The testing involved typing into the request body payload and then clicking "execute" to verify that what was typed was used for the request payload that was sent.
This should only affect OpenAPI 3 request body editing and sending.
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests