I have an image modal where the user can upload or paste an image. Both are working great, except currently I have the buttons on the modal capturing the focus, so pasting only works by manually clicking outside the buttons. I would like for any paste to work if this component has focus, or anything inside the component has focus.
<div onPaste="onPaste()">
<button class="__cancel" aria-label="Close" onClick="onClickCancel()">
<button ... upload .../>
</div>
Is there a way to allow the paste action to pass through the buttons?
This is actually an angular application, so below is closer to my actual code:
<div (paste)="onPaste($event)" cdkTrapFocusAutoCapture cdkTrapFocus>
<button class="__cancel" aria-label="Close" (onClick)="onClickCancel()">
<button ... upload .../>
</div>
I have tried adding the paste method to the buttons, but they don't fire.
<div (paste)="onPaste($event)" cdkTrapFocusAutoCapture cdkTrapFocus>
<button class="__cancel" aria-label="Close" (onClick)="onClickCancel()" (paste)="onPaste($event)">
<button ... upload (paste)="onPaste($event)".../>
</div>
Thank you