Harry StylesandOlivia Wildehad a cozy weekend before their relationship went public.

After Styles and Wilde were seenholding handsat a friend’s wedding in Montecito, California, over the weekend, a source confirmed to PEOPLE that “they have dated for a few weeks.”

In this week’s issue of PEOPLE, on newsstands Friday, sources said Wilde struck up a close friendship with Styles last fall as they began work on her highly-anticipated sophomore directorial projectDon’t Worry Darling, which she also stars in.

BACKGRID

Olivia Wilde, Harry Styles

As they spent time together on-and off-set, their friendship “quickly turned romantic,” said an insider. “Their chemistry was very obvious.”

“Everyone saw it coming. During breaks, he’s hasn’t been able to stay away and visited her trailer,” the source added.

Harry Styles visits Olivia Wilde’s Trailer on the set of “Don’t Worry Darling”.Backgrid

Olivia Wilde Harry Styles

Wilde cast Styles in the movie in September, replacing former lead Shia LaBeouf. Despite their growing relationship, the two continue to keep things “very professional” at work.

“Olivia and Harry created this loving and warm environment,” said the insider. “Everyone loved working with them. She takes her work very seriously, but everyone saw it coming.”

In Styles' recent cover story forVogue’s December issue, Wildeexplained why she was so excitedfor the former One Direction member to bring his enthusiasm to her “incredibly stylistic” movie.Don’t Worry Darlingcounts on Academy Award nominee designer Arianne Phillips (A Single Man) for costume design.

“To me, he’s very modern,” said Wilde of Styles, “and I hope that this brand of confidence as a male that Harry has—truly devoid of any traces of toxic masculinity—is indicative of his generation and therefore the future of the world. I think he is in many ways championing that, spearheading that. It’s pretty powerful and kind of extraordinary to see someone in his position redefining what it can mean to be a man with confidence.”

source: people.com