House Speaker Paul Ryan of Wis. faces reporters at Republican National Committee headquarters on Capitol Hill in Washington, Tuesday, May 24, 2016, following a closed-door caucus. Photo: (AP Photo/J. Scott Applewhite)

House Speaker Paul Ryan of Wis. faces reporters at Republican National Committee headquarters on Capitol Hill in Washington, Tuesday, May 24, 2016, following a closed-door caucus. Photo: (AP Photo/J. Scott Applewhite)

WASHINGTON (AP) — Speaker Paul Ryan is taking steps to bring greater order to the House floor after a Democrat-authored gay rights amendment caused chaos last week.

Ryan told House Republicans Tuesday that in the future, such amendments will have to be printed ahead of time. Current rules can allow amendments to be written and voted on in real time when spending bills are up for debate.

It’s a procedural change that could allow the GOP majority to better manage politically problematic votes.

“You don’t like to have surprises,” said Rep. Phil Roe, R-Tenn., as he exited the closed-door GOP meeting where Ryan announced the planned change. “If you want to play tricks and games that’s fine. If you’re interested in doing legislation you ought to have thought it through.”

Last week Democratic Rep. Sean Patrick Maloney offered a gay rights amendment that was about to pass, before seven Republicans changed their votes under pressure from House GOP leaders, and the amendment failed.

Outraged Democrats chanted “Shame! Shame!” as Republicans switched their votes. GOP lawmakers and aides said Maloney’s amendment caught them by surprise and they had to take quick action against it in order to salvage the underlying legislation, a spending bill to pay for popular veterans and military construction projects.

But the result was a messy scene the GOP wants to avoid repeating. A similar scenario flared last year on an amendment related to the Confederate flag, and Democrats had already made clear that they would be bringing Maloney’s amendment back up on other spending bills.

A Ryan aide said that the pre-printing requirement was being discussed but had not yet been finalized.

The issue has emerged as a test for Ryan, who has committed himself to more openness and inclusion in how the House operates. One result of an open process can be tough votes and Ryan has committed himself to confronting those head-on. In calling for amendments to be printed in advance he appears to be trying to strike a balance between openness and chaos.

“If we’re going to have open rules in appropriations, which we have, which is regular order, people are going to have to take tough votes. And I think people are acknowledging this,” Ryan said last week.

Democrats criticized the move. “This change seems intended to give leadership more time to figure out how to defeat amendments like Rep. Maloney’s preventing LGBT discrimination, which would have passed if not for their strong arm tactics,” said Matthew Dennis, spokesman for Rep. Nita Lowey of New York, top Democrat on the House Appropriations Committee.

© 2016, Associated Press, All Rights Reserved.

This material may not be published, broadcast, rewritten, or redistributed.