[Bug] custom_html does not allow to insert unclosed html tags
See original GitHub issuerefs: #1819
Bug report
When we introduced wrappers to the fields we broken the ability to insert custom tags around a group of fields because they will self close when contained inside the wrapper element.
$this->crud->addField([ // CustomHTML
'name' => 'fieldset_open',
'type' => 'custom_html',
'value' => '<fieldset>'
]);
//output
<div>
<fieldset>
</fieldset> //we are not adding this, it's auto closed because it's contained inside the field wrapper div
</div>
What I did
Tried to create a fieldset inside a crud form.
$this->crud->addField([ // CustomHTML
'name' => 'fieldset_open',
'type' => 'custom_html',
'value' => '<fieldset>'
]);
$this->crud->addField([
'name' => 'wysiwyg',
'type' => 'tinymce'
]);
$this->crud->addField([ // CustomHTML
'name' => 'fieldset_close',
'type' => 'custom_html',
'value' => '</fieldset>',
]);
What I expected to happen
My field beeing wrapped inside the fieldset.
What happened
The fieldset element is autoclosed because it’s contained inside the wrapper div.
What I’ve already tried to fix it
Remove wrapper from custom_html.blade.php
I think when we first started working on wrapper we left custom_html
out, and then put it back in to make all fields have the same functionality.
If it’s a custom_html, the wrapping of the field should be done by developer @tabacitu ?
I think we have two solutions:
1 - Remove wrapper from custom_html field.
2 - Introduce wrapper => false
to disable field wrapping.
I would vouche for the second as it would allow to disable wrapper in other fields too.
Let me know @tabacitu ! o/
Best, Pedro
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
I converted this into two PR’s.
https://github.com/Laravel-Backpack/PRO/pull/86 and https://github.com/Laravel-Backpack/CRUD/pull/4625
Closing in favor of keeping any discussion regarding this in https://github.com/Laravel-Backpack/CRUD/pull/4625
We could also keep it ‘on’ as default, with the option to turn it off, then it will not be a breaking change