Document is not focused error when Document.hasFocus()

Viewed 717

I have a simple piece of code that calls await navigator.clipboard.writeText("Hi").

My issue is that, according to Sentry, it throws a "NotAllowedError: Document is not focused.".

Where I am confused is that according to logs just above it, document.hasFocus() returns True. So the document has focus, but it is throwing a non-focus error?

Any ideas on how to fix this or where to log more?

Thanks in advance

0 Answers
Related