textbox: fix a regression in caret setting