godot – _input not called for a node inside a Viewport

I have a scene with two viewports, the “root” viewport and another inside it, like this:

Root
- SomeNode1
- SomeNode2
- RootCamera
- Viewport
  - SomeDeeperNode1
  - ViewportCamera

Now, I have a script attached to a node that belongs to the Viewport node, and it works otherwise, but its _input() method is not called. The script itself works because if I move it out of Viewport (so that it’s under Root node) it works fine. Is there something that should be taken into consideration for the _input() method to be invoked when it’s located inside another viewport?