rename dont select file ext

This commit is contained in:
Niklas 2021-08-29 21:31:01 +02:00
parent 1354383860
commit 61387e9fd8

View File

@ -16,7 +16,9 @@ const Renameable: React.FC<Props> = (props) => {
useEffect(()=>{ useEffect(()=>{
if (props.edit){ if (props.edit){
const i = inputValue.lastIndexOf(".")
inputRef.current?.select() inputRef.current?.select()
inputRef.current?.setSelectionRange(0,i == -1?inputValue.length:i)
}else{ }else{
setinputValue(props.text) setinputValue(props.text)
} }