offsetWidth returns 0 if called before rendering

better initialize textWidth on user's first click to make sure it is rendered