Merge pull request #672 from therealrinku/fix

feat: scroll to the active tab on click
This commit is contained in:
Anoop M D 2023-10-19 23:49:02 +05:30 committed by GitHub
commit a1d54eacf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,17 @@ const CollectionItem = ({ item, collection, searchText }) => {
'item-focused-in-tab': item.uid == activeTabUid
});
const scrollToTheActiveTab = () => {
const activeTab = document.querySelector('.request-tab.active');
if (activeTab) {
activeTab.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
};
const handleClick = (event) => {
//scroll to the active tab
setTimeout(scrollToTheActiveTab, 50);
if (isItemARequest(item)) {
dispatch(hideHomePage());
if (itemIsOpenedInTabs(item, tabs)) {