fix: Long titles should wrap

closes #1249
This commit is contained in:
Tom Moor
2020-05-07 21:21:58 -07:00
parent 06a3258b99
commit 48c87a1902
3 changed files with 15 additions and 153 deletions

View File

@@ -1,6 +1,7 @@
// @flow
import * as React from 'react';
import styled from 'styled-components';
import Textarea from 'react-autosize-textarea';
import { inject, observer } from 'mobx-react';
import Editor from 'components/Editor';
import PublishingInfo from 'components/PublishingInfo';
@@ -70,6 +71,7 @@ class DocumentEditor extends React.Component<Props> {
offsetLeft={startsWithEmojiAndSpace}
readOnly={readOnly}
autoFocus={!title}
maxlength={100}
/>
<Meta document={document}>
{totalViews && !isDraft ? (
@@ -98,7 +100,7 @@ const Meta = styled(PublishingInfo)`
font-size: 14px;
`;
const Title = styled('input')`
const Title = styled(Textarea)`
z-index: 1;
line-height: 1.25;
margin-top: 1em;
@@ -113,6 +115,7 @@ const Title = styled('input')`
outline: none;
border: 0;
padding: 0;
resize: none;
&::placeholder {
color: ${props => props.theme.placeholder};