-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure the double-click event is not ignored in the browser tree.
- Loading branch information
1 parent
a410b15
commit 98f6b1f
Showing
4 changed files
with
72 additions
and
28 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
web/pgadmin/static/js/components/PgTree/FileTreeItem/DoubleClickHandler.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useSingleAndDoubleClick } from '../../../custom_hooks'; | ||
import * as React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import CustomPropTypes from '../../../../js/custom_prop_types'; | ||
|
||
export default function DoubleClickHandler({onSingleClick, onDoubleClick, children}){ | ||
const onClick = useSingleAndDoubleClick(onSingleClick, onDoubleClick) ; | ||
return( | ||
<div onClick={(e)=>onClick(e)}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
DoubleClickHandler.propTypes = { | ||
onSingleClick: PropTypes.func, | ||
onDoubleClick: PropTypes.func, | ||
children: CustomPropTypes.children | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters