adds support for contenteditable, copied and adapt from https://github.com/yuku-t/jquery-textcomplete/pull/38