mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Ensure that autocomplete does not appear when navigating code using arrow keys. Fixes #7573
2) Fixed an issue where autocomplete is not working after clearing the query editor. Fixes #7563
This commit is contained in:
@@ -423,7 +423,8 @@ export default function CodeMirror({currEditor, name, value, options, events, re
|
||||
let pref = pgWindow?.pgAdmin?.Browser?.get_preferences_for_module('sqleditor') || {};
|
||||
if (autocomplete && pref.autocomplete_on_key_press) {
|
||||
editor.current.on('keyup', (cm, event)=>{
|
||||
if (!cm.state.completionActive && event.key != 'Enter' && event.key != 'Escape') {
|
||||
var pattern = new RegExp('^[ -~]{1}$');
|
||||
if (!cm.state.completionActive && (event.key == 'Backspace' || pattern.test(event.key))) {
|
||||
OrigCodeMirror.commands.autocomplete(cm, null, {completeSingle: false});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user