I had the same issue with it coming unattached easily.
Turned out I didn't have the black clips opened and the keyboard locked into place with them.
Once I figured that out, I've had zero issues and have to say this is the perfect case for what my needs are.