title: onpaste input event in blazor and typescript
body: <p>The <code>@onpaste</code> is a blazor DOM event executed when content is pasted in an input.
  now, I want to get this text content from typescript (blazor doesn't support it).</p>
  <p>razor:</p>
  <pre><code>@inject IJSRuntime _Js
  
  &lt;input class=&quot;otp-input&quot;
             @ref=&quot;myInputRef&quot;
             @onpaste=&quot;HandleOnPaste&quot; /&gt;
  @code {
  
      private ElementReference myInputRef { get; set; }
  
      private async Task HandleOnPaste()
      {
          var pastedData = await _js.InvokeAsync&lt;string?&gt;(&quot;OtpInput.getPastedData&quot;)
          
          // DO Something
      }
      
  }
  </code></pre>
  <p>ts:</p>
  <pre><code>class OtpInput {
      static getPastedData(e: ClipboardEvent) {
  
          let pastedData = e.clipboardData!.getData('text');
  
          return pastedData;
      }
  }
  </code></pre>
  <p>this does not work and return error: <code>TypeError: Cannot read properties of undefined (reading 'clipboardData')</code></p>