How to insert new DOM element to search-menu widget


I am trying to modify html for search-menu widget via overriding html method. Anybody can help me please? I am new in discourse forum and may be I don’t understand something. All I need to do it’s add div element to search menu. It’s not hard to do for components - I can use didInsertElement and use jquery for working with DOM. But what about widget?

Thank you.

Are you only trying to add new elements or are you trying to modify what’s already there?

Yes, I am trying to add new element. Search component has own html prepared by html() method. I want to add new DOM element to the end of this html. I am trying to use:

api.reopenWidget('search-menu', {
                html() {

for modification.

To be more precise I changed the stylesheet for this component and made it fullscreen. I can close it via pressing ECS and I want to add close link element to this component.

Here is screenshot

It’s default popup for searching…

1 Like