question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] custom_html does not allow to insert unclosed html tags

See original GitHub issue

refs: #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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pxpmcommented, Aug 30, 2022

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

1reaction
rabolcommented, Feb 9, 2021

We could also keep it ‘on’ as default, with the option to turn it off, then it will not be a breaking change

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing unclosed HTML tags - php - Stack Overflow
What I get is two unclosed tags <p> and <div> , p wont create much trouble , but div just messes with the...
Read more >
Website trouble FAQ - Support – cargocollective.com
Entire website has disappeared. This can happen when there is an unclosed HTML tag somewhere in your Custom HTML area, usually a script,...
Read more >
What happens if we don't add a closing tag? - HTML FAQ
Answer If you do not add a closing tag for an HTML element, ... However, excluding a closing tag will not cause error...
Read more >
lit-plugin - Visual Studio Marketplace
☯ no-unclosed-tag. Unclosed tags, and invalid self closing tags like custom elements tags, are checked. The following examples are considered ...
Read more >
Self Closing Tags in HTML (With Examples) - Tutorials Tonight
For example, closing a <input> tag like <input></input> is not valid. But the question is do we need to close these tags by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found