First of all, the same issue was already filed last year for Affinity Photo 1.10, however, I now have the same problem with Affinity Photo 2.1.1. I think, this happened to me in the past with some previous version, too.
Problem
The problem in general is, that sometimes the UI stops responding to user input, with the only exception being the artboard. You can draw, but you cannot click any buttons or even save the file. The only way out is to force close the application, you cannot even click Save using the keyboard.
Reproduction
I attached a screen recording showing that problem. It this very instance, switching between applications and between input devices (from pen to mouse) seems to have triggered the issue. However, I think I could also trigger it by just using the pen and switching between windows. The linked thread concluded with Windows Ink being the problem, but using High or Low Precision in the Affinity Photo settings instead did not solve the issue. Furthermore, disabling hardware acceleration also did not solve the issue - maybe only reducing the chances of happening. All of this happens only sometimes, but it is reliable enough to reproduce within maybe two minutes of trying.
Hardware
CPU: AMD FX-8320
RAM: 12GB DDR3 1600
GPU: GTX 1070
Tablet: Wacom Intuos Pro M PTH-660
Mouse: Logitech MX Vertical
Software
Windows 10 22H2 19045.3324
GPU-Driver 531.79
Affinity Photo 2.1.1
Tablet-Driver 6.4.2-3
affinity-photo-bug.mp4