@@ -35,6 +35,7 @@ import {
3535 countMatched ,
3636 configs ,
3737 shouldApplyAnimation ,
38+ mapAndFilter ,
3839 isMacOS ,
3940} from '/common/common.js' ;
4041import * as ApiTabs from '/common/api-tabs.js' ;
@@ -719,17 +720,20 @@ async function handleDefaultMouseUpOnTab({ lastMousedown, tab, event } = {}) {
719720 }
720721
721722 if ( lastMousedown . detail . isMiddleClick ) { // Ctrl-click doesn't close tab on Firefox's tab bar!
722- log ( `onMouseUp: middle click on the tab ${ tab . id } : ` , lastMousedown . detail . targetType ) ;
723+ log ( `onMouseUp: middle click on the tab ${ tab . id } : targetType = ` , lastMousedown . detail . targetType ) ;
723724 if ( lastMousedown . detail . targetType != 'tab' ) // ignore middle click on blank area
724725 return false ;
725726 const tabs = TreeBehavior . getClosingTabsFromParent ( tab , {
726727 byInternalOperation : true
727728 } ) ;
728- Sidebar . confirmToCloseTabs ( tabs . map ( tab => tab . $TST . sanitized ) )
729+ log ( 'tabs: ' , tabs ) ;
730+ const sanitizedTabsToClose = mapAndFilter ( tabs , tab => tab . $TST . isNativeTabGroup ? undefined : tab . $TST . sanitized ) ;
731+ log ( 'sanitizedTabsToClose: ' , sanitizedTabsToClose ) ;
732+ Sidebar . confirmToCloseTabs ( sanitizedTabsToClose )
729733 . then ( async confirmed => {
730734 if ( ! confirmed )
731735 return ;
732- const tabIds = tabs . map ( tab => tab . id ) ;
736+ const tabIds = sanitizedTabsToClose . map ( tab => tab . id ) ;
733737 await Scroll . tryLockPosition ( tabIds , Scroll . LOCK_REASON_REMOVE ) ;
734738 BackgroundConnection . sendMessage ( {
735739 type : Constants . kCOMMAND_REMOVE_TABS_BY_MOUSE_OPERATION ,
0 commit comments