fix(core): linked doc named input box has excessive desire to select all (#8861)

Fix issue [AF-1706](https://linear.app/affine-design/issue/AF-1706).
This commit is contained in:
akumatus
2024-11-20 06:25:36 +00:00
parent 2857568f03
commit b0ca3c6d58
3 changed files with 16 additions and 12 deletions
@@ -21,7 +21,7 @@ export const useAutoFocus = <T extends HTMLElement = HTMLElement>(
export const useAutoSelect = <T extends HTMLInputElement = HTMLInputElement>(
autoSelect?: boolean
) => {
const ref = useAutoFocus<T>(autoSelect);
const ref = useRef<T | null>(null);
useLayoutEffect(() => {
if (ref.current && autoSelect) {