If we consider a canonical transformation from $(q,p)$ to $(Q,P)$, it is stated in several sources that by Jacobian rules, $$ \frac{\partial(Q,P)}{\partial(q,p)} = \frac{\partial(Q,P)/\partial(q,P)}{\partial(q,p)/\partial(q,P)}. \tag{1} $$
By taking books such as Riley's Mathematical Methods for physics and engineering, I could confirm that this is indeed true (section 6.4.4). However, I have tried this myself and it seems that I am missing something. For instance the left hand side of the above equation expands in:
$$ \frac{\partial(Q,P)}{\partial(q,p)}=\begin{vmatrix} \frac{\partial Q}{\partial q} & \frac{\partial Q}{\partial p}\\ \frac{\partial P}{\partial q} & \frac{\partial P}{\partial p}\\ \end{vmatrix} = \frac{\partial Q}{\partial q}\frac{\partial P}{\partial p} - \frac{\partial Q}{\partial p}\frac{\partial P}{\partial q} $$
Now, the numerator of the right hand side is
$$ \frac{\partial(Q,P)}{\partial(q,P)}=\begin{vmatrix} \frac{\partial Q}{\partial q} & \frac{\partial Q}{\partial P}\\ \frac{\partial P}{\partial q} & \frac{\partial P}{\partial P}\\ \end{vmatrix} = \frac{\partial Q}{\partial q}\frac{\partial P}{\partial P} - \frac{\partial Q}{\partial P}\frac{\partial P}{\partial q}=\frac{\partial Q}{\partial q} $$
Then, the denominator is
$$ \frac{\partial(q,p)}{\partial(q,P)}=\begin{vmatrix} \frac{\partial q}{\partial q} & \frac{\partial q}{\partial P}\\ \frac{\partial p}{\partial q} & \frac{\partial p}{\partial P}\\ \end{vmatrix} = \frac{\partial q}{\partial q}\frac{\partial p}{\partial P} - \frac{\partial q}{\partial P}\frac{\partial p}{\partial q}=\frac{\partial p}{\partial P} $$
yielding the right hand side of the first equation above:
$$ \frac{\partial(Q,P)/\partial(q,P)}{\partial(q,p)/\partial(q,P)} = \frac{\partial Q}{\partial q}\frac{\partial P}{\partial p} $$
which corresponds to the first term of the second equation above. This means that the second term of the second equation above has to be zero. However, I fail to see why this is true. Assuming that $Q=Q(p,q)$ and $P=P(p,q)$, that term should have a value. What am I missing?