mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-29 15:50:05 -05:00
1 parent
6bc4341383
commit
4c5702dd47
2 files changed
+10
-1
No files matched your search
@@ -20,6 +20,8 @@ Bundled PostgreSQL Utilities
|
||||
New features
|
||||
************
|
||||
|
||||
| `Issue #9699 <https://github.com/pgadmin-org/pgadmin4/issues/9699>`_ - Add support for closing a tab with a middle-click on its title.
|
||||
|
||||
Housekeeping
|
||||
************
|
||||
|
||||
|
||||
@@ -54,6 +54,13 @@ export function TabTitle({id, closable, defaultInternal}) {
|
||||
layoutDocker.eventBus.fireEvent(LAYOUT_EVENTS.CONTEXT, e, id);
|
||||
}, []);
|
||||
|
||||
const onMouseDown = useCallback((e)=>{
|
||||
if(closable && e.button === 1) {
|
||||
e.preventDefault();
|
||||
layoutDocker.close(id);
|
||||
}
|
||||
}, [closable, id, layoutDocker]);
|
||||
|
||||
useEffect(()=>{
|
||||
// Initialize visibility immediately once the effect runs and layoutObj is available
|
||||
setIsVisible(layoutDocker?.isTabVisible(id) ?? false);
|
||||
@@ -119,7 +126,7 @@ export function TabTitle({id, closable, defaultInternal}) {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Box display="flex" alignItems="center" title={attrs.tooltip} onContextMenu={onContextMenu} width="100%">
|
||||
<Box display="flex" alignItems="center" title={attrs.tooltip} onContextMenu={onContextMenu} onMouseDown={onMouseDown} width="100%">
|
||||
{attrs.icon && <span className={`dock-tab-icon ${attrs.icon}`}></span>}
|
||||
{showServerColorIndicator && attrs.bgcolor && !isVisible && (
|
||||
<Box
|
||||
|
||||
Reference in new issue
Block a user