mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added the ability to display the selected text from the query tool in the find/replace box. #5249
This commit is contained in:
parent
3765131d21
commit
0203bbc7ef
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user