If the condition is truly the jaw stuck in the open position, then it is usually hyperextension.
Hyperextension is most common in fishes that feed on aufwuchs (algal turfs and their associated microfauna), and is caused by the locking of a bone called the urohyal into the cleithra, it may be easily resolved without damage by anesthetizing the fish with MS-222 and using a fine, blunt tipped probe to gently depress the urohyal from the INSIDE of the jaw, this "unlocks" the jaw. If the jaw is pushed back from the outside one or both of the cleithra may fracture, resulting in a possibly life-long deformation.
No hobbyists usually perform this procedure. Best handled by a vet. Of course, this is assuming that is the proper diagnosis.
There are times when a nourishment deficiency brings such a condition on. But the deficiency would be chronic (over a long period of time in developing). Not sure it would apply here, though.
Lastly, a muscular/neurological damage issue could lead to this, in which case the fish will return to normal after it repairs itself. If nourished properly, the fish will heal on its own.
Not really all that much to do other than wait and maybe review the feeding regime and diet to reduce the likelihood of this in the future.