Quarkonium production as a function of the charged-particle multiplicity could provide an insight into particle production processes at the partonic level in hadronic collisions. It is believed that multiple partonic interactions play an important role in particle production and affect both soft and hard processes. The study of correlations between quarkonia and charged-particle multiplicity may provide information about this. In this contribution, ALICE measurements of J$/psi$ and $Upsilon$ production as a function of charged-particle multiplicity are presented for pp collisions at center-of-mass energies $sqrt{s}$ = 5.02 and 13 TeV. A similar measurement performed in ptextendash Pb collisions at $sqrt{s_{rm{NN}}}$ = 8.16 TeV at both forward and backward rapidity is also discussed.