diff --git a/CHANGES.md b/CHANGES.md index dda6ea314c7..37b3715e34e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,7 @@ Apollo 2.2.0 * [Bump springboot version from 2.7.9 to 2.7.11](https://github.com/apolloconfig/apollo/pull/4828) * [[Multi-Database Support][h2] Support run on h2](https://github.com/apolloconfig/apollo/pull/4851) * [Fix the issue that env special case handling is missing in some case](https://github.com/apolloconfig/apollo/pull/4887) +* [Fix the issue that namespace content being cleared when identical content is pasted into the namespace](https://github.com/apolloconfig/apollo/pull/4922) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/13?closed=1) \ No newline at end of file diff --git a/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js index 974c599d5f2..80ace173339 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js @@ -989,16 +989,8 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio }) }, onChange: function (e) { - if ((e[0].action === 'insert') && (scope.namespace.hasOwnProperty("editText")) && (scope.namespace.editText.length === 0)) { - let text = '' - for (let i = 0; i < e[0].lines.length; i++) { - if (i === 0) { - text = e[0].lines[0] - } else { - text += '\r\n' + e[0].lines[i] - } - } - scope.namespace.editText = text + if ((e[0].action === 'insert') && (scope.namespace.hasOwnProperty("editText"))) { + scope.namespace.editText = e[1].session.getValue(); } }