off edge
To be in the wrong state of mind; you're emotions are out of control, you don't say the right things, it's hard to concentrate on one simple thing, etc.
Example:
John snapped on Ms. Davidson because she told him to stop talking, and he hasn't been doing his work. He must be off edge.
John snapped on Ms. Davidson because she told him to stop talking, and he hasn't been doing his work. He must be off edge.