M. Gar M. Gar - 6 months ago 19
jQuery Question

panel-body textarea disappear after jquery filter

I show info in a section of collapse panels, the content are showed in

<textarea>
elements inside of the
panel-body
but the text that is showed are stored in
HTML
so I use
Summernote
to show it, that Works fine but when I make a search if that search match with the
panel-header
content the panel doesn't shows the textarea/summernote element.

Check the jsfiddle if you search for
one
makes the filter and shows you the right panel but when try to expand the panel the textarea/summernote element is not there. But if you search for
lorem
shows you the panel and can be expanded.

How can I solve this? is because the use of summernote or the jquery script I use to make the search?

Answer

Problem is easy to figure out when you inspect the live html. The summernote plugin also uses a panel class so when you hide panel it gets hidden too.

A quick workaround is use:

 $('.panel').not('.note-editor')

DEMO