TRENTON, N.J. — Future New Jersey governors couldn’t be caught like Gov. Chris Christie enjoying the July Fourth holiday on a state beach while it was closed to the public during a government shutdown under a proposal advancing through the Democrat-led Legislature.

A Senate committee recently advanced the bill that would require state parks and beaches to stay open during government shutdowns. The measure already passed the Assembly without any opposition.

The bill stems from a three-day government shutdown ahead of the July Fourth holiday when the term-limited governor and lawmakers failed to enact a budget by the end of the fiscal year on June 30. It calls for keeping state parks and recreation areas open for up to seven days after a state government shutdown.

The shutdown is mostly remembered for photos of Christie lounging on the beach at the state-owned governor’s mansion on Island Beach State Park, which he had ordered closed to the public because of the budget impasse.

The photos were captured by an NJ.com photographer who had rented a plane and found the governor and his family on a mostly-empty stretch of beach.

The photos became a sensation online, inspiring Halloween costumes and memes, including one that showed the lounging governor in the surf in a “From Here to Eternity”-style photo.

The impasse ended after the photos surfaced, though Christie said they had nothing to do with his finding a resolution with lawmakers. He defended his use of the house as a perk of the job and said he had long promised his family the vacation.

Lawmakers say the episode was a factor in their authoring the bill.

“Families were grossly inconvenienced by the unexpected government shutdown and that should never happen again,” said Democratic Assemblyman John McKeon, who authored the bill in the Assembly.

But the legislation has garnered some significant opposition. The labor union representing many state workers, the Communication Workers of America, said it has concerns that it would make it easier for future governors and lawmakers to shut government down.

Seth Hahn, a representative for the CWA, testified before the Senate panel that taking away the threat of park closures — especially during the July 4 holiday, which occurs at the start of the fiscal year when budgets are being enacted — makes it easier for shutdowns to occur.

He added that it’s unfair to keep other state workers off the job, potentially, for longer.

“We do think the parks are absolutely critical,” he said “But it’s not less critical than people doing unemployment benefits who have been laid off from their jobs.”

Democratic state Sen. Bob Smith, who chairs the committee that considered the bill, said the CWA made a “good point,” but it’s unclear how that might affect the legislation, which goes next to the full Senate.

The governor’s beach mansion became a factor in the race to succeed him this fall. Republican Lt. Gov. Kim Guadagno, distancing herself from the unpopular Christie, said she’d sell the property if elected. Democratic Gov.-elect Phil Murphy has not taken a position on selling the beach house, but said he’s open to considering it.

Neither Christie nor Murphy’s offices have responded about whether they’d sign the proposed legislation.

Murphy succeeds Christie on Jan. 16. He’ll be responsible for enacting a balanced budget by June 30.