Yes, you'll have to allocate the income to the state of residence at the time of the stock sale. The TurboTax FAQ I'm linking below will explain more.
How do I allocate split income for a part-year state return?
*Please click the thumbs-up icon if this response was helpful.
**Please click "Mark As Best Answer" if your question has been resolved. Thank you.
*** I am NOT a tax expert. I am a seasoned TurboTax user, and volunteer to provide assistance to TT users. Nothing I post is to be considered TAX ADVICE; I bear no legal liability for responses.***