How to clear the contents of a PnP people picker and rich text in an SPFx react webpart

25 views Asked by At

I have seen many questions posted on this subject, but none of the solutions work in my project.

I have a PnP people picker and a rich text in my SPFx webpart, and I would like to clear the contents of both text boxes every time that the submit button is clicked.

How would I do this?

Here is what my people picker control looks like.

   <PeoplePicker

              titleText="Who do you want to send a Spartan Gram to?"
              context={this.props.context}
              personSelectionLimit={1}
              showtooltip={false}
              required={true}
              disabled={false}
              searchTextLimit={3}
              onChange={this._getPeoplePickerItems}
              showHiddenInUI={false}
              principalTypes={[PrincipalType.User]}
              resolveDelay={300} 
              

              />
            </div>
            <br></br>
            <button className={`${styles.customSendButton}`} onClick={this.createSenderItem}>Send</button>

            </td>
            <td>
            <div className={`${styles.customInputBody}`}>
              <RichText id= {`richTextBody`} styleOptions={{showStyles:true, showBold:true, showUnderline:true, showItalic:true, showMore:true}} label="Add a message" value={this.props.richTextValue}
                onChange={(text)=>this.onTextChange(text)}
              />
              </div>

Thank you for your help.

0

There are 0 answers