Fix scroll on user settings (#28022)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c67a5b10e6
Коммит
5482792697
@@ -2,11 +2,13 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import type {ReactNode} from 'react';
|
import type {ReactNode} from 'react';
|
||||||
import React, {useEffect, useRef} from 'react';
|
import React, {useRef} from 'react';
|
||||||
|
|
||||||
import type SettingItemMinComponent from 'components/setting_item_min';
|
import type SettingItemMinComponent from 'components/setting_item_min';
|
||||||
import SettingItemMin from 'components/setting_item_min';
|
import SettingItemMin from 'components/setting_item_min';
|
||||||
|
|
||||||
|
import useDidUpdate from './common/hooks/useDidUpdate';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +56,7 @@ const SettingItem = ({
|
|||||||
}: Props) => {
|
}: Props) => {
|
||||||
const minRef = useRef<SettingItemMinComponent>(null);
|
const minRef = useRef<SettingItemMinComponent>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useDidUpdate(() => {
|
||||||
// We want to bring back focus to the edit button when the section is opened and then closed along with all sections are closed
|
// We want to bring back focus to the edit button when the section is opened and then closed along with all sections are closed
|
||||||
|
|
||||||
if (!active && areAllSectionsInactive) {
|
if (!active && areAllSectionsInactive) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user