I've created a spfx webpart on a list page in SharePoint 2016. After selecting items in the list I click a button which calls SP.ListOperation.Selection.getSelectedItems().

However, there is an eventlistener on the button added by SharePoint that deselects the items before I can get the ids. The click event looks like this:


It is visible using the devtools. How can I remove this event or better, how can I avoid the event bubble . I've tried e.preventDefault, e.stopPropagation() and return false. Removing the eventlistener manually using the devtool is the only way I can make it work.

1 Answer 1


Solution: convert button to input submit and wrap it in a form and add an onSubmit handler.

  <form onSubmit={this.handleSubmit}>
      <input type="submit" value="submit"/>

 handleSubmit = (e) => {


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.