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 control doesn't render as a child component on a page #326

Closed
naveedullahk opened this issue Jun 25, 2019 · 5 comments
Closed

RichText control doesn't render as a child component on a page #326

naveedullahk opened this issue Jun 25, 2019 · 5 comments
Labels
Needs: Author Feedback no-recent-activity status:tracked Triaged and are being investigated further

Comments

@naveedullahk
Copy link

naveedullahk commented Jun 25, 2019

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version 1.13.2

Expected / Desired Behavior / Question

Using RichText in a webpart, where it is used as a child component (field). the rich text should update the value (text displayed in the field) as soon as the state change occurs in the containing control (parent)

Observed Behavior

The RichText displays the value for the first time and then doesn't render the new value passed to it on subsequent renders.
Reviewing the code in RichText.tsx reveals that the props (value) being passed is only being assigned to the state (text) in the constructor. Subsequent render calls will not invoke the constructor and hence new value will not be updated in text. Missing componentWillReceiveProps lifecycle method

Steps to Reproduce

Create a component with a textbox, button and RichText control. In button click handler, set the value of textbox to the state which is passed to the RichText as props (value).

Please note that I tested the RichText after adding the method componentWillReceiveProps to the control and the issue seems to be fixed
`
public componentWillReceiveProps (nextProps:IRichTextProps){

this.setState({text:nextProps.value});

  }`
@ghost
Copy link

ghost commented Jun 25, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Jun 25, 2019
@estruyf estruyf added status:tracked Triaged and are being investigated further and removed Needs: Triage 🔍 labels Jul 9, 2019
@estruyf estruyf assigned estruyf and unassigned estruyf Jul 9, 2019
@nileshlaxmi
Copy link

Any updated on above request. When we are using componentWillReceiveProps or static getDerivedStateFromProps, it becomes very slow as it is being rendered.
Please help.

@michaelmaillot
Copy link
Collaborator

Hi @naveedullahk & @nileshlaxmi,

Latest version (3.15.0) handles missing part of the state management for the RichText control.

Is it working as expected now from your side?

@ghost
Copy link

ghost commented Aug 28, 2023

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

@ghost ghost closed this as completed Sep 4, 2023
@ghost
Copy link

ghost commented Sep 4, 2023

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback no-recent-activity status:tracked Triaged and are being investigated further
Projects
None yet
Development

No branches or pull requests

5 participants