ensure maxLength on topic titles
This commit is contained in:
parent
f3652b9ca6
commit
ec57d8d392
1 changed files with 4 additions and 1 deletions
|
@ -1,10 +1,12 @@
|
|||
import React, { Component, PropTypes } from 'react'
|
||||
import { RIETextArea } from 'riek'
|
||||
|
||||
const maxTitleLength = 140
|
||||
|
||||
class Title extends Component {
|
||||
nameCounterText() {
|
||||
// for some reason, there's an error if this isn't inside a function
|
||||
return `${this.props.name.length}/140`
|
||||
return `${this.props.name.length}/${maxTitleLength.toString()}`
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -19,6 +21,7 @@ class Title extends Component {
|
|||
id="titleActivator"
|
||||
classEditing="riek-editing"
|
||||
editProps={{
|
||||
maxLength: maxTitleLength,
|
||||
onKeyPress: e => {
|
||||
const ENTER = 13
|
||||
if (e.which === ENTER) {
|
||||
|
|
Loading…
Add table
Reference in a new issue