From 7dd7994e01dacb99bd291d0ab288ea769fb27f64 Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Mon, 20 Mar 2023 17:46:54 +0800 Subject: [PATCH] Make scrollIntoView center on the "Add channels" button. --- .../marketing/overview-multichannel/Channels/Channels.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx index 5abf9f0d13f..7427f3f15f1 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx @@ -66,7 +66,9 @@ export const Channels = forwardRef< ChannelsRef, ChannelsProps >( scrollIntoAddChannels: () => { setExpanded( true ); addChannelsButtonRef.current?.focus(); - addChannelsButtonRef.current?.scrollIntoView(); + addChannelsButtonRef.current?.scrollIntoView( { + block: 'center', + } ); }, } ), []