Fortunately, Democratic legislative leaders in New Jersey finally woke up, and realized voters are fed up with gerrymandering and want fair elections.

During the last several weeks, New Jersey’s Democratic legislative leaders pushed a plan to redraw district maps using voter data that would further entrench their dominance in state elections. But the plan ran into fierce opposition not only from Republicans, but also from Democrats, including Gov. Murphy and Eric Holder, the attorney general under President Barack Obama, who leads a group seeking to combat gerrymandering districts.

During hearings last week, more than 100 progressive activists and academics testified against the bill. The only supporters were the authors of the bill (Nicholas Scutari and Stephen Sweeney in the Senate, and Lou Greenwald and Carol Murphy​ in the Assembly).

In the face of such opposition, Senate President Sweeney and Assembly Speaker Craig Coughlin wisely decided on Monday to shelve the plan. This was a win for democracy. It was also a lesson for Democrats in New Jersey and beyond not to follow the same cynical path as their Republican colleagues, who moved to strip power from incoming Democratic leaders in Wisconsin and Michigan.

Polls show nearly everyone hates gerrymandering. Voters in four states – Colorado, Michigan, Missouri, and Utah — approved ballot measures last month that rein in partisan gerrymandering. In January, the Pennsylvania Supreme Court ruled the state’s congressional map, drawn by Republican lawmakers, was unconstitutional. The court gave the legislature and governor three weeks to develop a replacement map, but when an agreement could not be reached, it imposed its own.

Gov. Wolf created a bipartisan commission last month charged with finding ways to make redistricting in Pennsylvania more fair, but Republicans dismissed the executive order as grandstanding. Instead of whining, Republicans would be wise to work with Democrats to create a permanent independent commission to ensure fair districts going forward.

Gerrymandering has been around since the dawn of the republic, but Republicans in Pennsylvania and other states have taken it to new extremes in the last decade, especially after former Obama was elected in 2008,

First, Republicans focused on winning control of state governments that oversee the redistricting that takes place every decade after the census. Once in control, Republicans used sophisticated computer mapping to cluster Democrats into a handful of districts while packing the majority of districts with Republicans.

Such gerrymandering helped Republicans win two-thirds of the congressional seats in Pennsylvania despite usually losing the statewide popular vote. Under the redrawn maps, Democrats gained three seats and the incoming congressional delegation will be evenly split, 9-9, and include four women in the previous all-male club.

In New Jersey, Democrats already have significant majorities in both state houses. The latest power grab attempt didn’t sit well even with many Democrats.

Efforts to tilt districts to essentially rig elections before votes are even cast has infuriated voters and helped deepen the current partisan divide. Instead, lawmakers in New Jersey, Pennsylvania, and beyond should work to restore democracy and create fair and nonpartisan districts that ensure competition from all parties.