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 React, { Component, PropTypes } from 'react'
|
||||||
import { RIETextArea } from 'riek'
|
import { RIETextArea } from 'riek'
|
||||||
|
|
||||||
|
const maxTitleLength = 140
|
||||||
|
|
||||||
class Title extends Component {
|
class Title extends Component {
|
||||||
nameCounterText() {
|
nameCounterText() {
|
||||||
// for some reason, there's an error if this isn't inside a function
|
// 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() {
|
render() {
|
||||||
|
@ -19,6 +21,7 @@ class Title extends Component {
|
||||||
id="titleActivator"
|
id="titleActivator"
|
||||||
classEditing="riek-editing"
|
classEditing="riek-editing"
|
||||||
editProps={{
|
editProps={{
|
||||||
|
maxLength: maxTitleLength,
|
||||||
onKeyPress: e => {
|
onKeyPress: e => {
|
||||||
const ENTER = 13
|
const ENTER = 13
|
||||||
if (e.which === ENTER) {
|
if (e.which === ENTER) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue