Hi Iīm not a teacher at all
But I think the 1st one is correct because it refers to the noun not the verb.
Remember that to is a function word, it doesnīt just make the infinitive of a verb, but it also acts as a preposition(followd by a noun- in this case learning-) and as an adverb (without a following noun)
I hope it be of help, letīs wait and see what other people say
Student or Learner