https://www.theguardian.com/politics/2016/nov/02/tracy-brabin-pays-tribute-to-jo-cox-in-maiden-commons-speach
“Labour MP Tracy Brabin, who was elected to replace Jo Cox, has paid a moving tribute to her friend and predecessor,…”
“Brabin was elected without opposition from the major parties at the by-election to replace Cox,…”
“ ‘I wasn’t elected in a conventional way and it was in the darkest of circumstances through the loss of my friend and inspiration, Jo Cox, that I came to be here,’…’ Brabin said.”
https://www.mirror.co.uk/news/uk-news/actress-tracy-brabin-reveals-how-9002471
“Born only a few miles and 12 years apart, Jo and Tracy went to the same school in Heckmondwike and when Tracy volunteered for Jo’s general election campaign in 2015, they found they were “cut from the same cloth”. “
I think that made them fairly good mates. As youngmaf says, the electorate doesn’t get to choose a party’s candidate.