Added the ability to display the selected text from the query tool in the find/replace box. #5249

This commit is contained in:
Nikhil Mohite 2022-09-22 11:51:52 +05:30 committed by Akshay Joshi
parent 3765131d21
commit 0203bbc7ef
2 changed files with 8 additions and 0 deletions

View File

@ -24,4 +24,5 @@ Housekeeping
Bug fixes
*********
| `Issue #5249 <https://github.com/pgadmin-org/pgadmin4/issues/5249>`_ - Added the ability to display the selected text from the query tool in the find/replace box.
| `Issue #5308 <https://github.com/pgadmin-org/pgadmin4/issues/5308>`_ - Ensure that the default value for a column should be used if it is made empty.

View File

@ -132,6 +132,7 @@ export const CodeMirrorInstancType = PropTypes.shape({
addOverlay: PropTypes.func,
setSelection: PropTypes.func,
scrollIntoView: PropTypes.func,
getSelection: PropTypes.func,
});
export function FindDialog({editor, show, replace, onClose}) {
@ -146,6 +147,12 @@ export function FindDialog({editor, show, replace, onClose}) {
const search = ()=>{
if(editor) {
// Get selected text from editor and set it to find/replace input.
let selText = editor.getSelection();
if(selText.length != 0) {
setFindVal(selText);
}
let query = parseQuery(findVal, useRegex, matchCase);
if(!query) return;