diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js index d0f903409..930a67999 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js +++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js @@ -119,11 +119,12 @@ export default class PgaJobStepSchema extends BaseUISchema { options: this.fieldOptions.databases, controlProps: {allowClear: true, placeholder: ''}, disabled: function(state) { - let retVal = !state.jstkind || !state.jstconntype; - if (retVal) { - state.jstdbname = null; + return !state.jstkind || !state.jstconntype; + }, + depChange: (state)=>{ + if (!state.jstkind || !state.jstconntype) { + return {jstdbname: null}; } - return retVal; }, deps: ['jstkind', 'jstconntype'], helpMessage: gettext('Please select the database on which the job step will run.'),