In determining the person or persons to whom custody should be granted under paragraph (2) or (3) of subdivision (a) of Section 3040, the court shall consider and give due weight to the nomination of a guardian of the person of the child by a parent under Article 1 (commencing with Section 1500) of Chapter 1 of Part 2 of Division 4 of the Probate Code.