Content-Length: 299599 | pFad | http://github.com/umbraco/Umbraco-CMS/pull/19514

CA Tiptap RTE: Toolbar/statusbar config initial value state by leekelleher · Pull Request #19514 · umbraco/Umbraco-CMS · GitHub
Skip to content

Tiptap RTE: Toolbar/statusbar config initial value state #19514

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

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

leekelleher
Copy link
Member

Description

Fixes #19009.

Prevents setting the toolbar/statusbar value until after the component has been initialized.

To test, follow instructions from issue #19009.

@Copilot Copilot AI review requested due to automatic review settings June 9, 2025 15:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes issue #19009 by preventing the toolbar and statusbar value from being set until after their components have fully initialized.

  • Introduce a private #initialized flag and guard value updates on it
  • Add undefined checks in the getters
  • Delay initial calls to setToolbar/setStatusbar until firstUpdated()

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/.../property-editor-ui-tiptap-toolbar-configuration.element.ts Added #initialized guard, updated getter, and moved initial setToolbar call
src/.../property-editor-ui-tiptap-statusbar-configuration.element.ts Added #initialized guard, updated getter, and moved initial setStatusbar call
Comments suppressed due to low confidence (2)

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/tiptap/components/property-editor-ui-tiptap-statusbar-configuration.element.ts:69

  • Use the public getter (this.value) instead of the private #value field here to apply the same clone logic and avoid passing undefined on initial render.
this.#context.setStatusbar(this.#value);

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/tiptap/components/property-editor-ui-tiptap-toolbar-configuration.element.ts:73

  • Introduce unit or integration tests that verify the toolbar and statusbar values are not set until after initialization, ensuring the new guard behavior works as expected.
protected override firstUpdated() {

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

This looks good and tests out well for me. Before the PR was applied I could see the issue, and then after rebuilding with the code from this PR I could navigate in and out of rich text data types without seeing the issue.

I did have one exception which isn't going to be that useful to report - I had a few rich text editors and on one of them only I could still replicate the problem on. However after saving once, the issue went away and I can't replicate it any more.

I'll leave you to merge in case you want a second review, but for me, it's good to go in.

@leekelleher
Copy link
Member Author

I did have one exception which isn't going to be that useful to report - I had a few rich text editors and on one of them only I could still replicate the problem on. However after saving once, the issue went away and I can't replicate it any more.

Thanks @AndyButland

The issue is reproducible when either the toolbar or statusbar is empty.

As the server makes those values as null, but the UI initialised them with an empty array, resulting in the "Discard changes" prompt.

@leekelleher leekelleher merged commit 69224cb into main Jun 10, 2025
28 checks passed
@leekelleher leekelleher deleted the v16/bugfix/tiptap-config-wait-init branch June 10, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

V15 "Discard changes" appears even though nothing is changed
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/umbraco/Umbraco-CMS/pull/19514

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy