updated caret positioning on collapsable panel