Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update content field #2464

Merged
merged 2 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dirty-pianos-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/field-content': patch
---

Changed the min-height of the content field. Changed the UI so the blocks menu doesn't appear if there are not blocks configured.
1 change: 1 addition & 0 deletions packages/field-content/src/views/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ let ContentField = ({ field, value, onChange, autoFocus, errors }) => {
css={{
...inputStyles({ isMultiline: true }),
padding: '16px 32px',
minHeight: 200,
zIndex: 0,
}}
/>
Expand Down
2 changes: 2 additions & 0 deletions packages/field-content/src/views/editor/add-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ let AddBlock = ({ editorState, editor, blocks }) => {
return;
}

if (!blocks || !blocks.length) return;

if (elm && editor && editor.el.contains(elm)) {
iconEle.style.top = `${elm.offsetTop + elm.offsetHeight / 2}px`;
iconEle.style.left = 0;
Expand Down