From 64cdd509b0d3c1d5a687d45c3fcdb3acff7848e5 Mon Sep 17 00:00:00 2001 From: Satish V Date: Fri, 17 Jul 2020 12:08:23 +0530 Subject: [PATCH] Fixed save button enable issue when focusing in and out of numeric input field. Fixes #5137 --- docs/en_US/release_notes_4_24.rst | 1 + web/pgadmin/browser/static/js/datamodel.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_24.rst b/docs/en_US/release_notes_4_24.rst index 01f38f26f..4d1e3017a 100644 --- a/docs/en_US/release_notes_4_24.rst +++ b/docs/en_US/release_notes_4_24.rst @@ -28,6 +28,7 @@ Bug fixes | `Issue #3814 `_ - Fixed issue of error message not getting displayed when filename is empty for backup, restore, and import/export. | `Issue #3851 `_ - Add proper indentation to the code while generating functions, procedures, and trigger functions. | `Issue #4235 `_ - Fixed tab indent issue on a selection of lines is deleting the content when 'use spaces == true' in the preferences. +| `Issue #5137 `_ - Fixed save button enable issue when focusing in and out of numeric input field. | `Issue #5287 `_ - Fixed dark theme-related CSS and modify the color codes. | `Issue #5414 `_ - Use QStandardPaths::AppLocalDataLocation in the runtime to determine where to store runtime logs. | `Issue #5463 `_ - Fixed an issue where CSV download quotes numeric columns. diff --git a/web/pgadmin/browser/static/js/datamodel.js b/web/pgadmin/browser/static/js/datamodel.js index 47a7316fe..1e3c81c12 100644 --- a/web/pgadmin/browser/static/js/datamodel.js +++ b/web/pgadmin/browser/static/js/datamodel.js @@ -367,8 +367,12 @@ define([ return; } attrs[k] = v; + const attrsDefined = self.origSessAttrs[k] && v; /* If the orig value was null and new one is empty string, then its a "no change" */ - if (_.isEqual(self.origSessAttrs[k], v) || (self.origSessAttrs[k] === null && v === '')) { + /* If the orig value and new value are of different datatype but of same value(numeric) "no change" */ + if (_.isEqual(self.origSessAttrs[k], v) + || (self.origSessAttrs[k] === null && v === '') + || (attrsDefined ? _.isEqual(self.origSessAttrs[k].toString(), v.toString()) : false)) { delete self.sessAttrs[k]; } else { self.sessAttrs[k] = v;