10-20-2020 02:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-20-2020 02:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I have a TextArea on my Settings index.jsx. I can disable or enable the component based on a user selection but I would like to "hide" or not display the TextArea instead of just disabling it. Is this possible?
Answered! Go to the Best Answer.

Accepted Solutions
10-21-2020 11:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-21-2020 11:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I got this to work using the code below in my index.jsx file. If the Select component has a value of 'testing', then the TextInput component will be displayed.
{
(typeof props.settings.format !== constants.UNDEFINED && JSON.parse(props.settings.format).values[0].value === 'testing') && <TextInput type="text" maxLength="10" label="Test Label" settingsKey="testing" />
}

10-20-2020 12:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-20-2020 12:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
This can be done. See the Toggle examples.
Gondwana Software

10-21-2020 02:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-21-2020 02:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I assume you are referring to the Toggle sample below? If so, can you explain how this hides/displays the Toggle? I'm missing something, thank you. ( (I had to remove HTML from the code snippet so I could post the code.)
<Toggle
settingsKey="toggle"
label="Toggle Switch"
/>
{ JSON.parse(settings.toggle || 'false') and <Toggle settingsKey="hiddenToggle" /> }

10-21-2020 11:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-21-2020 11:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I got this to work using the code below in my index.jsx file. If the Select component has a value of 'testing', then the TextInput component will be displayed.
{
(typeof props.settings.format !== constants.UNDEFINED && JSON.parse(props.settings.format).values[0].value === 'testing') && <TextInput type="text" maxLength="10" label="Test Label" settingsKey="testing" />
}

