adding the url-select on click

This commit is contained in:
Pulkit 2024-08-06 19:09:10 +05:30
parent 1d0b0313ea
commit 1a71490c9b

View file

@ -40,6 +40,7 @@ const AddressBar = () => {
const [homepage, setHomepage] = useState<string>(
window.electron.store.get('homepage')
);
const [isFocused, setIsFocused] = useState(false);
const [deleteStorageLoading, setDeleteStorageLoading] =
useState<boolean>(false);
const [deleteCookiesLoading, setDeleteCookiesLoading] =
@ -262,10 +263,17 @@ const AddressBar = () => {
onChange={(e) => setTypedAddress(e.target.value)}
onKeyDown={handleKeyDown}
onBlur={() => {
setIsFocused(false);
setTimeout(() => {
setIsSuggesting(false);
}, 100);
}}
onSelect={(e) => {
if (e.target === inputRef.current && !isFocused) {
inputRef.current?.select();
setIsFocused(true);
}
}}
/>
<div
className={`${