Skip to content

Commit d517e92

Browse files
committed
fix(rich-text-web): don't re-render on onChange or onKeyPress prop change
1 parent 70376be commit d517e92

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

packages/pluggableWidgets/rich-text-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue when Rich Text widget loosing focus after running onChange or onKeyPress microflow.
12+
913
## [2.1.4] - 2023-03-22
1014

1115
### Fixed

packages/pluggableWidgets/rich-text-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rich-text-web",
33
"widgetName": "RichText",
4-
"version": "2.1.4",
4+
"version": "2.1.5",
55
"description": "Rich inline or toolbar text editing",
66
"copyright": "© Mendix Technology BV 2023. All rights reserved.",
77
"repository": {

packages/pluggableWidgets/rich-text-web/src/components/Editor.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ export class Editor extends Component<EditorProps> {
8080
return false;
8181
}
8282

83+
if (key === "onChange") {
84+
return false;
85+
}
86+
87+
if (key === "onKeyPress") {
88+
return false;
89+
}
90+
8391
return prevProps[key] !== nextProps[key];
8492
});
8593
}

packages/pluggableWidgets/rich-text-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="RichText" version="2.1.4" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="RichText" version="2.1.5" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="RichText.xml" />
66
</widgetFiles>

0 commit comments

Comments
 (0)