A sizable number of U.S. voters say they'd have some hesitancy about supporting an LGBTQ candidate for president, according to a new poll from The Associated Press-NORC Center for Public Affairs Research. In fact it's an issue for many more than a candidate's race or gender.

In the poll, 32 percent of registered voters said they would be less excited about supporting a presidential candidate who is gay, lesbian or bisexual; 42 percent said that about a transgender candidate. By contrast, only about 1 in 10 voters expressed such hesitance in regard to a candidate's gender or race.

Yet many LGBTQ candidates have overcome such attitudes, even winning statewide elections, and political experts predict that the path for future LGBTQ office-seekers will steadily grow smoother.

One intriguing test case: the presidential campaign of Pete Buttigieg, the mayor of South Bend, Indiana, who has gained significant support with minimal controversy over the fact that he's gay.

"While the polling data shows there is still reluctance to vote for an LGBT candidate among a minority of the electorate, that reluctance has been steadily declining," said Professor Charles Franklin, a pollster at Marquette University in Milwaukee. "There are more success stories demonstrating that LGBT candidates can win despite this disadvantage."

He cited two LGBTQ candidates who won statewide races in swing states last year: Democrats Tammy Baldwin of Wisconsin, easily re-elected to the U.S. Senate, and Jared Polis of Colorado, the first openly gay man elected governor.

The poll finds that Republican voters are especially likely to show resistance to LGBTQ candidates. But even among Democrats, 18 percent said they'd be less excited to vote for a gay, lesbian or bisexual candidate. Older Democrats and those who describe themselves as moderates or conservatives were more likely to have reservations than their younger and more liberal counterparts.

David Flaherty, a Republican pollster in Colorado, said generational demographics are likely to be pivotal in making it easier for LGBTQ candidates to win, given that voters under 45 are far more open to them.

"That 32 percent is not an insurmountable hurdle," Flaherty said. "A lot of it is the 65 and older voters. As those folks pass on, sexual orientation will be an afterthought in future elections."

He said sexual orientation never became a major issue during the governor's campaign in Colorado by Polis, who won by 10 percentage points over his Republican opponent with strong support from young and independent voters.

It's a trend that has unfolded over many years. In a recent Gallup poll, 76 percent of Americans expressed a willingness to vote for a gay or lesbian presidential candidate, up from 26 percent when Gallup first asked the question in 1978.

Other polls show broad backing for LGBTQ rights. A Pew Research Center poll in March pegged Americans' support for same-sex marriage at 61 percent; a new Gallup poll found that 71 percent support allowing transgender people to serve in the military, a stance at odds with President Donald Trump's efforts to sharply restrict their military presence.

Buttigieg is the most prominent test right now of how Americans view LGBTQ politicians. He has neither highlighted being gay nor sought to play it down. He's indicated he's comfortable showing affection for his husband, Chasten, during their occasional joint appearances.

Appearing recently on NBC's "Meet the Press," Buttigieg mentioned his overwhelming re-election victory in South Bend in 2015 just months after coming out.

"What that tells you, I think, is that people, if you give them the chance, will evaluate you based on what you aim to do, what the results are, what the policies are," he said.

That's a message that the LGBTQ Victory Fund conveys to the LGBTQ candidates it endorses for various levels of elective office across the U.S.

"We tell our candidates, no one is going to vote for you because you're LGBT," said Annise Parker, a lesbian who served three terms as mayor of Houston and is now the fund's CEO.

Referring to the AP-NORC poll, she said, "If you only have one data point about a candidate — a data point that puts them in a minority status you don't share — you might have some hesitations."

"But we don't vote for hypothetical gay candidate X — we vote for someone who's a part of the community, who has a plan for addressing some issues," she said. "The goal is to represent ourselves as whole people, and give them multiple data points."

The new poll suggests that it might be a harder climb for transgender candidates than for gays and lesbians.

In liberal Vermont, the country's first major-party transgender candidate for governor, Democrat Christine Hallquist, won 40 percent of the votes in November against Republican Gov. Phil Scott, who took 55 percent.

In 2017, Democrat Danica Roem became the first transgender person to win a state legislative seat, ousting a Republican who served 13 terms in Virginia's House of Delegates.

"My gender was a non-factor among Democrats," said Roem, whose campaign emphasized job creation and fixing traffic problems.

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM