Fix insertAtCaret for use with itemSelector setting