When the delete button is clicked, we want to display a popup asking the user to confirm if they want to delete the article. We do this with a confirmation, which is just an alert with pre-built “Yes” and “No” buttons.

Update your delete_article_button_click function to look like this:

  def delete_article_button_click(self, **event_args):
    # Check that the user does want to delete the selected article
    confirm(f"Are you sure you want to delete {self.item['title']}?")

This will display a confirmation popup with the article’s title, asking the user if they want to delete the article. Run your app, click on the delete button to make sure the confirmation works.

Screenshot of the delete confirmation popup