fix(component): stop renaming modal propagation & input auto focus (#7653)
close AF-1125
This commit is contained in:
@@ -44,6 +44,7 @@ export const RenameModal = ({
|
|||||||
side: 'left',
|
side: 'left',
|
||||||
onPointerDownOutside: handleRename,
|
onPointerDownOutside: handleRename,
|
||||||
sideOffset: -12,
|
sideOffset: -12,
|
||||||
|
onClick: e => e.stopPropagation(),
|
||||||
}}
|
}}
|
||||||
items={
|
items={
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@@ -58,7 +58,11 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
|||||||
const inputRef = useRef<HTMLInputElement | null>(null);
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (inputRef.current && (autoFocus || autoSelect)) {
|
if (inputRef.current && (autoFocus || autoSelect)) {
|
||||||
inputRef.current?.focus();
|
// to avoid clicking on something focusable(e.g MenuItem),
|
||||||
|
// then the input will not be focused
|
||||||
|
setTimeout(() => {
|
||||||
|
inputRef.current?.focus();
|
||||||
|
}, 0);
|
||||||
if (autoSelect) {
|
if (autoSelect) {
|
||||||
inputRef.current?.select();
|
inputRef.current?.select();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user