Markdown shortcuts for checkbox lists
This commit is contained in:
@@ -22,28 +22,26 @@ export default class TodoItem extends Component {
|
||||
const { children, checked, readOnly } = this.props;
|
||||
|
||||
return (
|
||||
<StyledLi contentEditable={false}>
|
||||
<input
|
||||
<ListItem>
|
||||
<Checkbox
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={this.handleChange}
|
||||
disabled={readOnly}
|
||||
/>
|
||||
{' '}
|
||||
<span contentEditable={!readOnly} suppressContentEditableWarning>
|
||||
{children}
|
||||
</span>
|
||||
</StyledLi>
|
||||
{children}
|
||||
</ListItem>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const StyledLi = styled.li`
|
||||
input {
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
|
||||
&:last-child:focus {
|
||||
outline: none;
|
||||
}
|
||||
const ListItem = styled.li`
|
||||
padding-left: 1.4em;
|
||||
position: relative;
|
||||
`;
|
||||
|
||||
const Checkbox = styled.input`
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0.4em;
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user