Hi, I'm a freelance will writer in my spare time (also work in a high street practice as a family and wills lawyer), and this is something I come across quite regularly.
You can certainly appoint your partner as Guardian of your daughter, but you need to be aware that that appointment doesn't prevent your ex from making an application under the Children Act for residence.
If he did make that application, the court would have to consider whether it was in the best interests of your daughter to stay with your partner or go to live with her father.
This isn't an exhaustive list, but some of the factors the court would consider:
How long your daughter had, at that time, been living with your partner
How often she normally sees her dad
Whether her dad or your partner can best provide for her educational, emotional, physical and social needs
Whether there are any allegations of poor care by either the partner or the dad
Your daughter's wishes and feelings (not the last thing the court would consider by any means).
If you'd like to talk offline about making wills, my email address is [email protected], or you could PM me.