input框全选之setSelectionRange

<InputItem
      ref = {ref => this[inputRef] = ref}
      onFocus={(e)=>{
            if(this[inputRef] && this[inputRef].inputRef && this[inputRef].inputRef.inputRef) {
                 const ref = this[inputRef].inputRef.inputRef;
                 ref.select && ref.select();
                 setTimeout(()=> {
                       ref.setSelectionRange && ref.setSelectionRange(0, 99999);
                 }, 100);
            }
     }}
/>
原文地址:https://www.cnblogs.com/cnlg123/p/14811962.html