Can't use 2 widgets in one field?
Submitted by papi Jo on Thu, 02/11/2021 - 18:53
Forums:
Hi fellow developers,
In a custom H5P activity I have a text field in which I need 2 widgets:
- "widget": "html" to enable end-user to format text
- "widget": "showWhen" to display that text field or not, depending on the boolean value of another field.
It seems that I can only have one of these 2 widgets for that text field. Is that the normal behaviour? Is there a workaround?
Thanks!
Summary:
using widgets for text field in semantics
papi Jo
Tue, 03/02/2021 - 18:13
Permalink
Any takers?
Any takers?
otacke
Tue, 03/02/2021 - 19:48
Permalink
Hi Papi Jo!I think your only
Hi Papi Jo!
I think your only option is to wrap the text field into a group and attach the showWhen widget to the group. That's a little ugly as a workaround, but can be made a little nicer if you add a custom form widget to restyle the editor.
Best,
Oliver
papi Jo
Thu, 03/04/2021 - 16:34
Permalink
Thanks Oliver,
Thanks Oliver,
Just tried your solution of wrapping text inside a group and it does work.
otacke
Thu, 03/04/2021 - 21:52
Permalink
Hi Papi Jo!As I mentioned: It
Hi Papi Jo!
As I mentioned: It's a little ugly because of the extra group stuff in the editor, but it should do the trick and some custom CSS may come to the rescue.
Best,
Oliver