From 61387e9fd856c72cd9d13757f5fb4a93dbb775e8 Mon Sep 17 00:00:00 2001 From: Niklas Date: Sun, 29 Aug 2021 21:31:01 +0200 Subject: [PATCH] rename dont select file ext --- src/components/Renameable.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Renameable.tsx b/src/components/Renameable.tsx index bda3e38..da0485d 100644 --- a/src/components/Renameable.tsx +++ b/src/components/Renameable.tsx @@ -16,7 +16,9 @@ const Renameable: React.FC = (props) => { useEffect(()=>{ if (props.edit){ + const i = inputValue.lastIndexOf(".") inputRef.current?.select() + inputRef.current?.setSelectionRange(0,i == -1?inputValue.length:i) }else{ setinputValue(props.text) }