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

RichText view mode trouble #287

Open
itrygoodlife opened this issue Apr 29, 2019 · 4 comments

Comments

@itrygoodlife
Copy link

commented Apr 29, 2019

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version

version of the library: [1.13.0]

Expected / Desired Behavior / Question

No problem work in view mode

Observed Behavior

If youre try to open page with rich text editor in view mode it will not render complete. Need to click edit page then publish it, and only then it will display correctly.

Steps to Reproduce

1)Build webpart with rich text editor
2) pass dynamic isEditMode to props of Richtext Editor
3) Deploy it on page
2) Open page - there are no text editor. Click edit - it appear. click Publish - all ok. Reload page - here we go again

image

@niranjan747

This comment has been minimized.

Copy link

commented May 17, 2019

Facing the same issue , any updates to this ?

@estruyf estruyf added the type:bug label May 17, 2019

@estruyf

This comment has been minimized.

Copy link
Collaborator

commented May 17, 2019

@hugoabernier any chance you can take a look at this?

@estruyf estruyf assigned estruyf and unassigned estruyf May 17, 2019

@joeljeffery

This comment has been minimized.

Copy link

commented May 23, 2019

Here's a quick hack if anyone needs this right now:

image

class SafeRichText extends RichText {
  public componentDidMount() {
    if (this.props.isEditMode) {
      super.componentDidMount();
    }
  }
}

Swap <SafeRichText /> in place of <RichText />

Here's the original code:
image

I think the brace at line 140 needs to be moved down to line 149, then the problem should go away :)

Joel

@estruyf

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

@joeljeffery has fixed this, and the changes are applied in the latest beta version of 1.14.0. Please feel free to test it out. More information about how to use a beta version can be found here: https://sharepoint.github.io/sp-dev-fx-controls-react/beta/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.