-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Editor not resetting when the same markdown #7625
fix: Editor not resetting when the same markdown #7625
Conversation
if (currentPagePath != null) { | ||
editorRef.current?.setValue(initialValue); | ||
} | ||
}, [currentPagePath, initialValue]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ページが変更されても CodeMirror に行き渡る initialValue が同じだと CodeMirror のコード値は変わらないので、明示的に初期値に更新
@@ -571,7 +571,7 @@ class CodeMirrorEditor extends AbstractEditor { | |||
|
|||
changeHandler(editor, data, value) { | |||
if (this.props.onChange != null) { | |||
const isClean = data.origin == null || editor.isClean(); | |||
const isClean = data.origin == null || editor.isClean() || value === this.props.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
値が同じままの際は clean とする。
(今回の実装で isEnabledUnsavedWarning が true とならないように追記)
…n-same-markdown
reg-suit detected visual differences. Check this report, and review them. 🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴 What do the circles mean?The number of circles represent the number of changed images.🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
プロダクションビルドで動作確認し期待通りでした。 |
review task
https://redmine.weseek.co.jp/issues/121597