mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 22:43:11 +02:00
Tree fixes and sidebar filter DSL
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import type { EditorView } from '@codemirror/view';
|
||||
import type { HttpRequest } from '@yaakapp-internal/models';
|
||||
import classNames from 'classnames';
|
||||
import type { FormEvent, ReactNode } from 'react';
|
||||
@@ -6,7 +5,7 @@ import { memo, useRef, useState } from 'react';
|
||||
import { useHotKey } from '../hooks/useHotKey';
|
||||
import type { IconProps } from './core/Icon';
|
||||
import { IconButton } from './core/IconButton';
|
||||
import type { InputProps } from './core/Input';
|
||||
import type { InputHandle, InputProps } from './core/Input';
|
||||
import { Input } from './core/Input';
|
||||
import { HStack } from './core/Stacks';
|
||||
|
||||
@@ -44,15 +43,11 @@ export const UrlBar = memo(function UrlBar({
|
||||
isLoading,
|
||||
stateKey,
|
||||
}: Props) {
|
||||
const inputRef = useRef<EditorView>(null);
|
||||
const inputRef = useRef<InputHandle>(null);
|
||||
const [isFocused, setIsFocused] = useState<boolean>(false);
|
||||
|
||||
useHotKey('url_bar.focus', () => {
|
||||
const head = inputRef.current?.state.doc.length ?? 0;
|
||||
inputRef.current?.dispatch({
|
||||
selection: { anchor: 0, head },
|
||||
});
|
||||
inputRef.current?.focus();
|
||||
inputRef.current?.selectAll();
|
||||
});
|
||||
|
||||
const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
|
||||
|
||||
Reference in New Issue
Block a user