Add a workaround for IE error

IE throws an error when calling setSelectionRange for an element that's not in the DOM (probably)