Fix expand/collapse button in the document editor #7926
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.
Because of some problems with the current expanded view in the document editor (the auto-scrolling of the editor on selection changes scrolls to a broken position, the save button is hidden, etc.), this PR changes the expand/collapse button to switch between re-sizable to full height (while still being in the normal document flow).
This also reverts previous changes to the background colour based on focus because they don't work well since the editor can be conceptually focused (e.g. while updating where a link goes to, editing a form in a component block or etc.) even though the contenteditable element is not literally focused which creates a very strange experience of the editor looking blurred while you're still doing something inside of it.
Before: https://keystone-next-docs-3hjwvrtn8-thinkmill.vercel.app/docs/guides/document-field-demo
After: https://keystone-next-docs-82foenqiv-thinkmill.vercel.app/docs/guides/document-field-demo