mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-25 22:41:30 +02:00
fix: middle button click to close - SpecialTab and RequestTabNotFound tab (#3044)
This commit is contained in:
parent
087bab6fb4
commit
98a7aa1357
@ -49,9 +49,10 @@ const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUi
|
|||||||
|
|
||||||
const handleMouseUp = (e) => {
|
const handleMouseUp = (e) => {
|
||||||
if (e.button === 1) {
|
if (e.button === 1) {
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
// Close the tab
|
||||||
dispatch(
|
dispatch(
|
||||||
closeTabs({
|
closeTabs({
|
||||||
tabUids: [tab.uid]
|
tabUids: [tab.uid]
|
||||||
@ -68,7 +69,10 @@ const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUi
|
|||||||
const folder = folderUid ? findItemInCollection(collection, folderUid) : null;
|
const folder = folderUid ? findItemInCollection(collection, folderUid) : null;
|
||||||
if (['collection-settings', 'folder-settings', 'variables', 'collection-runner', 'security-settings'].includes(tab.type)) {
|
if (['collection-settings', 'folder-settings', 'variables', 'collection-runner', 'security-settings'].includes(tab.type)) {
|
||||||
return (
|
return (
|
||||||
<StyledWrapper className="flex items-center justify-between tab-container px-1">
|
<StyledWrapper
|
||||||
|
className="flex items-center justify-between tab-container px-1"
|
||||||
|
onMouseUp={handleMouseUp} // Add middle-click behavior here
|
||||||
|
>
|
||||||
{tab.type === 'folder-settings' ? (
|
{tab.type === 'folder-settings' ? (
|
||||||
<SpecialTab handleCloseClick={handleCloseClick} type={tab.type} tabName={folder?.name} />
|
<SpecialTab handleCloseClick={handleCloseClick} type={tab.type} tabName={folder?.name} />
|
||||||
) : (
|
) : (
|
||||||
@ -82,7 +86,17 @@ const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUi
|
|||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return (
|
return (
|
||||||
<StyledWrapper className="flex items-center justify-between tab-container px-1">
|
<StyledWrapper
|
||||||
|
className="flex items-center justify-between tab-container px-1"
|
||||||
|
onMouseUp={(e) => {
|
||||||
|
if (e.button === 1) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
dispatch(closeTabs({ tabUids: [tab.uid] }));
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
<RequestTabNotFound handleCloseClick={handleCloseClick} />
|
<RequestTabNotFound handleCloseClick={handleCloseClick} />
|
||||||
</StyledWrapper>
|
</StyledWrapper>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user