Bug 242 - delete error not reported
[osm/UI.git] / skyquake / plugins / composer / src / src / components / ContentEditableDiv.js
1 /**
2 * Created by onvelocity on 2/13/16.
3 */
4 'use strict';
5 import React from 'react'
6 import ClassNames from 'classnames'
7 export default function ContentEditableDiv (props) {
8
9 const fontWidth = parseFloat(props.fontWidth) || 15;
10 const size = props.autoPadRight ? Math.max(50, String(props.name).length * fontWidth) : 0;
11 const style = {borderColor: 'transparent', background: 'transparent'};
12 if (size) {
13 style.paddingRight = size;
14 }
15
16 return (
17 <div className={ClassNames('ContentEditableDiv', {'-is-disabled': props.disabled})}><input {...props} style={style} /></div>
18 );
19
20 }