Skip to content

Commit 67fe472

Browse files
Merge pull request #615 from bcgsc/merge-master-to-dev-7.0.1
update develop from master-7.0.1
2 parents 4f03c1b + 99e47ec commit 67fe472

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/components/IPRWYSIWYGEditor/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,21 @@ const IPRWYSIWYGEditor = ({
194194
}
195195
}, [editor, onClose]);
196196

197+
const handleOnClose = useCallback(() => {
198+
onClose(null);
199+
// Reset the editor text, since we don't deal with the state in React
200+
editor.commands.setContent(text);
201+
}, [onClose, editor, text]);
202+
197203
return (
198-
<Dialog fullWidth maxWidth="lg" open={isOpen} onClose={() => onClose(null)}>
204+
<Dialog fullWidth maxWidth="lg" open={isOpen} onClose={handleOnClose}>
199205
<DialogTitle>{title}</DialogTitle>
200206
<DialogContent>
201207
<MenuBar editor={editor} className="IPRWYSIWYGEditor__toolbar" />
202208
<EditorContent editor={editor} className="IPRWYSIWYGEditor__content" />
203209
</DialogContent>
204210
<DialogActions>
205-
<Button onClick={() => onClose(null)}>Close</Button>
211+
<Button onClick={handleOnClose}>Close</Button>
206212
<Button color="secondary" onClick={handleOnSave}>Save</Button>
207213
</DialogActions>
208214
</Dialog>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "ipr-client",
4-
"version": "7.0.0",
4+
"version": "7.0.1",
55
"keywords": [],
66
"license": "GPL-3.0",
77
"sideEffects": false,

0 commit comments

Comments
 (0)