ComPDFKit Web SDK
    Preparing search index...

    Function setClickMiddleware

    • Sets a function called with (dataElement, { type }) when a button is clicked, before the default handling; type is one of UI.ClickedItemTypes. Stored per instance; buttons without a dataElement do not trigger it.

      Parameters

      Returns void

      instance.UI.setClickMiddleware((dataElement, { type }) => {
      if (type === instance.UI.ClickedItemTypes.BUTTON)
      console.log('clicked', dataElement);
      });