Textarea depends hides entire widget
Closed this issue ยท 4 comments
Hi,
I've noticed an issue with your textarea component.
Preconditions
- Install Magento 2.2.3 (also tested on 2.2.5)
- Create a custom module
Steps to reproduce
- Create a widget.xml in your custom module and add a widget
- Create two parameters (field) inside parent tag widgets>widget>parameters, to the textarea parameter you'll add a
<depends>
tag, making it depend on the value of a select parameter. As follows:
<parameter name="hide_textarea" xsi:type="select" visible="true" source_model="Magento\Config\Model\Config\Source\Yesno">
<label translate="true">Hide textarea component</label>
</parameter>
<parameter name="textarea" xsi:type="block" visible="true">
<label translate="true">Textarea</label>
<depends>
<parameter name="hide_textarea" value="0" />
</depends>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\Textarea" />
</parameter>
Expected result
The textarea
field should be hidden when the hide_textarea
is set to Yes
Actual result
The entire widget options gets hidden when hide_textarea
is set to Yes
Thanks for reporting the issue. ๐ I will have a look later today. :)
@captainfromspace working fine for me (just inserted your parameters to the Link widget for testing), see video:
https://drive.google.com/file/d/13DN9duBQ5IsWOVNTGKKsoLpb37HiDzTB/view
Update: It seems it is also working poperly if I create widget instance on the Content > Widget page.
Thanks for taking a look, @tkotosz. I just restarted my browser and now it works just fine. I'm sorry for waisting your time!
no problem :)