pnp / sp-dev-fx-controls-react

Reusable React controls for SPFx solutions
https://pnp.github.io/sp-dev-fx-controls-react/
MIT License
382 stars 379 forks source link

Maximum update depth exceeded when selecting a text in Rich Text Control #1515

Open muecke36 opened 1 year ago

muecke36 commented 1 year ago

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version

Please specify what version of the library you are using: [3.11.0]

Expected / Desired Behavior / Question

No errors when selecting text

Observed Behavior

If I select text in the Richt Text Control the app crashes with the react error "Maximum update depth exceeded"

Steps to Reproduce

Select any text in a Rich Text Control

ghost commented 1 year ago

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

github-actions[bot] commented 1 year ago

Thank you for submitting your first issue to this project.

muecke36 commented 1 year ago

Any news on this?

GuidoZam commented 1 year ago

Hi @muecke36 , I've tried to reproduce the bug with no luck...can you please provide the code to reproduce it? Can you also provide which version of SPFx are you using?

muecke36 commented 1 year ago

The code looks like this:

  <RichText
    value={values?.comment ?? "-"}
    onChange={(text) => {
      values.comment = text
      setValues(values, true)
      return text
    }}
  />

If I select the dash in the richt text control the error is thrown and the app crashes. The SPfx version is 1.15.2.

Dependencies look like this:

"@azure/msal-browser": "^2.32.2",
"@fluentui/example-data": "^8.3.0",
"@fluentui/react": "^8.60.1",
"@fluentui/react-file-type-icons": "^8.6.2",
"@microsoft/sp-core-library": "1.15.2",
"@microsoft/sp-lodash-subset": "1.15.2",
"@microsoft/sp-office-ui-fabric-core": "1.15.2",
"@microsoft/sp-page-context": "1.15.2",
"@microsoft/sp-property-pane": "1.15.2",
"@microsoft/sp-webpart-base": "1.15.2",
"@pnp/graph": "^3.7.0",
"@pnp/logging": "^3.7.0",
"@pnp/sp": "^3.7.0",
"@pnp/spfx-controls-react": "^3.11.0",
"csstype": "^3.0.10",
"cypress-msal-login": "^1.0.7",
"formik": "^2.2.9",
"js-cookie": "^3.0.1",
"luxon": "^2.3.1",
"office-ui-fabric-react": "7.185.7",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-hot-toast": "^2.2.0",
"react-router-dom": "^6.4.3",
"rxjs": "^7.5.5",
"typescript": "^4.5.5",
"uuid": "^9.0.0",
"yup": "^0.32.11"
GuidoZam commented 6 months ago

Hi @muecke36 sorry for the late response, I tried recreating a project with the dependencies of your last post but still works like a charm, at this point I think that probably the issue is in your code, maybe there is a loop while setting the state?