src/react/puppeteer/src/js/views/add-device-modal/ModalView.js
/**
   * Triggered whenever the name field is updated.
   * Checks whether the name is valid (non-empty) and sets
   * the state accordingly.
   */
Triggered whenever the name field is updated.
Checks whether the name is valid (non-empty) and sets
the state accordingly.
Triggered whenever the name field is updated . Checks whether the name is valid ( non - empty ) and sets the state accordingly .
handleUpdateName(e) {
    const string = e.target.value.toString().trim();
    const regex = new RegExp(/^$|^\s+$/);
    if(!string.match(regex)) {
      this.setState({
        name: string,
        validName: true,
      });
    } else {
      this.setState({
        name: '',
        validName: false,
      });
    }
  }
handleUpdateName ( e ) { const string = e . target . value . toString ( ) . trim ( ) ; const regex = new RegExp ( / ^$|^\s+$ / ) ; if ( ! string . match ( regex ) ) { this . setState ( { name : string , validName : true , } ) ; } else { this . setState ( { name : '' , validName : false , } ) ; } }
Triggered whenever the name field is updated.
Triggered whenever the name field is updated .