Skip to content
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

Merged

Conversation

arafubeatbox
Copy link
Contributor

@arafubeatbox arafubeatbox commented May 6, 2023

if (currentPagePath != null) {
editorRef.current?.setValue(initialValue);
}
}, [currentPagePath, initialValue]);
Copy link
Contributor Author

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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

値が同じままの際は clean とする。
(今回の実装で isEnabledUnsavedWarning が true とならないように追記)

@arafubeatbox arafubeatbox temporarily deployed to VRT May 8, 2023 00:07 — with GitHub Actions Inactive
@reg-suit
Copy link

reg-suit bot commented May 8, 2023

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.

@jam411
Copy link
Contributor

jam411 commented May 9, 2023

プロダクションビルドで動作確認し期待通りでした。

@yuki-takei yuki-takei changed the title fix: editor not resetting when same markdown fix: Editor not resetting when the same markdown May 9, 2023
@yuki-takei yuki-takei merged commit 67f8c9e into master May 9, 2023
26 checks passed
@yuki-takei yuki-takei deleted the fix/115285-116132-editor-not-resetting-when-same-markdown branch May 9, 2023 12:37
@github-actions github-actions bot mentioned this pull request May 9, 2023
@yuki-takei yuki-takei mentioned this pull request May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants