It was pegged but they pegged it at a number that was stronger than it would otherwise be. China fears capital flight more than anything, and rich people in China would absolutely sell their yuan for dollars or euros in an instant if they could.
Capital controls and the peg are why real estate in China is a bubble. There's no other place for people to put their savings. Rich people who know better don't trust the CCP.