Capital gains from other states

Hi,

I lived in Texas from Oct 2018 to Sep 2020 and moved back to California in Oct 2020.  While in Texas, I sold some stocks and earned capital gains in 2020.  It's my understanding that I don't report stock capital gains for 2020 California income tax because I sold them before moving to California.   Is this correct?   California Turbox Tax form has a question like "Earned/Rec'd From CA Source as if CA Nonresident for Full Year"  One stock I sold is that I bought them when I worked in California about 5 years ago.   Do I need to care about this?