This question already has an answer here:
A circus acrobat of mass M leaps straight up with initial velocity $v_0$ from a trampoline. As he rises up, he takes a trained monkey of mass m off a perch at a height h above the trampoline. What is the maximum height attained by the pair?
The only thing I don't understand is why the vertical momentum is conserved when the acrobat catches the monkey despite the presence of gravitational force?
That's the only part in the solution where the conservation of momentum will be used to find the final velocity of acrobat and monkey.
I guessed that it must be because of normal force balancing the gravitational force out but am not sure of it.