pnp / sp-dev-fx-controls-react

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

DynamicForm issue rendering Managed Metadata with "Display term label in the field" with NULL value #1896

Open YarrickAms opened 2 weeks ago

YarrickAms commented 2 weeks ago

Category

[ ] Enhancement

[x] Bug

[x] Question

Version

Please specify what version of the library you are using: image

Expected / Desired Behavior / Question

When a managed metadata is defined as one of the column values of my Library List, and has no default value and expects to display only the term label. It will result in a error, because the value is NULL. I tried to overcome the problem by using the "fieldOverrides" property, but it only runs after running the normal rendering and displaying the error. Because the business case, I can't add a default value for the columns, nor change the way they value is displayed. Is there a way to overcome this issue? For an existing item I think I can overwrite the property values after collecting the list item, but for non existing items (creating a new) it would still create errors. I notice hiding the columns works, but I like the columns to be presented in the form.

Observed Behavior

When running the code, the form isn't loaded and an error is displayed immediately.

The error: image

The specific part of the script failing: image

DynamicForm being used image

The code for custom rendering is dummy code to just check the functionality.

Thanks!

github-actions[bot] commented 2 weeks ago

Thank you for submitting your first issue to this project.