Ability to have conditional properties defined in propertiesMetadata() #10456
Mark Bice (mbice)
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We have many custom web parts that render out author contributed content that is set in the properties pane. In many cases, we need this content to be searchable, so we expose these properties in propertiesMetadata() and define their type (plain text, html, link, etc). This works really well, but where we are running into issues is the scenario where we have other web part properties that might be used to disable a group of properties, resulting in differences in how the content is rendered.
For example, you may have a property toggle that shows another set of web part properties, which will render on the page and we would want to be searchable. However, if those properties have content in them and the toggle is disabled, we have no way of removing it from propertiesMetadata conditionally. In that step in the web part lifecycle I can't seem to access other properties so I have no way of checking whether or not the property in question should be searchable.
Is there another way to achieve this that I'm not understanding? If not, then it would make sense to me that one of the following is done.
Thoughts?
All reactions