src/react/puppeteer/src/js/views/add-device-modal/ModalView.js
/**
   * Triggered whenever the description field is updated.
   * Checks whether the description is valid (non-empty)
   * and sets the state. The description is not required,
   * but recommended, so an empty description gives a warning.
   */
Triggered whenever the description field is updated.
Checks whether the description is valid (non-empty)
and sets the state. The description is not required,
but recommended, so an empty description gives a warning.
Triggered whenever the description field is updated . Checks whether the description is valid ( non - empty ) and sets the state . The description is not required but recommended so an empty description gives a warning .
handleUpdateDesc(e) {
    const string = e.target.value.toString().trim();
    const regex = new RegExp(/^$|^\s+$/);
    if(!string.match(regex)) {
      this.setState({
        desc: string,
        validDesc: false,
      });
    } else {
      this.setState({
        desc: '',
        validDesc: true,
      })
    }
  }
handleUpdateDesc ( e ) { const string = e . target . value . toString ( ) . trim ( ) ; const regex = new RegExp ( / ^$|^\s+$ / ) ; if ( ! string . match ( regex ) ) { this . setState ( { desc : string , validDesc : false , } ) ; } else { this . setState ( { desc : '' , validDesc : true , } ) } }
Triggered whenever the description field is updated.
Triggered whenever the description field is updated .