Allow only letters for question name
This commit is contained in:
@@ -126,7 +126,10 @@ class IntentDetails extends Component {
|
||||
handleIntentNameEdit(e){
|
||||
if (e.length === INTENT_NAME_MAX_LENGTH) return;
|
||||
let newIntent = this.state.intent;
|
||||
newIntent.intentName = e.replace(/\s/g, ''); //remove all spaces from intent name
|
||||
//Allow question name with only letters, and with one character minimum
|
||||
if (/^[a-z]+$/i.test(e)){
|
||||
newIntent.intentName = e;
|
||||
}
|
||||
this.setState({intent: newIntent});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user