The legislation would bar local governments from banning single-use plastic bags.