mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-27 07:21:51 +02:00
Merge pull request #672 from therealrinku/fix
feat: scroll to the active tab on click
This commit is contained in:
commit
a1d54eacf6
@ -87,7 +87,17 @@ const CollectionItem = ({ item, collection, searchText }) => {
|
|||||||
'item-focused-in-tab': item.uid == activeTabUid
|
'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) => {
|
const handleClick = (event) => {
|
||||||
|
//scroll to the active tab
|
||||||
|
setTimeout(scrollToTheActiveTab, 50);
|
||||||
|
|
||||||
if (isItemARequest(item)) {
|
if (isItemARequest(item)) {
|
||||||
dispatch(hideHomePage());
|
dispatch(hideHomePage());
|
||||||
if (itemIsOpenedInTabs(item, tabs)) {
|
if (itemIsOpenedInTabs(item, tabs)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user