import React from 'react'; import CharLimit from './decorators/CharLimit' import styled from 'styled-components' import FloatingLabel from './decorators/FloatingLabel' import Dropdown from 'react-dropdown'; import { LANGS, THEMES } from './renderers/Code'; const RelPositioning = styled.div` position: relative; height: calc(100% - 4em); ` const FlexChild = styled.div` display: block; margin-left: 2em; ` class TitleInput extends React.Component { render() { return ( ); } } class PasteInput extends React.Component { constructor(props) { super(props) this.textArea = React.createRef() this.handleKeyDown = this.handleKeyDown.bind(this) } handleKeyDown(e) { if (e.keyCode === 9) { // tab was pressed // prevent autofocus on next intput e.preventDefault(); // get selection start and end const start = e.target.selectionStart const end = e.target.selectionEnd this.props.insertTabCallback(start, end) // set cursor position to be at start e.target.selectionEnd = end + 4; } } render() { return (