mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Pass options to scrollIntoView
This commit is contained in:
@@ -55,7 +55,11 @@ export default function ElementView({ index, style }: Props) {
|
||||
const component = useRef(null);
|
||||
useEffect(() => {
|
||||
if (isSelected && component.current !== null) {
|
||||
component.current.scrollIntoView();
|
||||
component.current.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center',
|
||||
inline: 'center',
|
||||
});
|
||||
}
|
||||
}, [isSelected]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user