Reply To: Strange behaviour


Ernest Marcinko


That is even worse, because it's not solvable with any option or code within the search – as it is caused by the menu. The search simply gets removed from the DOM tree by the menu script, which also causes all the javascript handlers to be deleted. It does not simply hide the search node, but completely deletes it from the document, and it looks like, whenever I scroll back to the top it gets copied back.

Please check this video as proof. To prove it, I'm changing the 'placeholder' text to 'TEST' before I scroll down the screen. If the menu does not touch the search node, it will not change at all, and that is what should happen normally. But as you can see, it reverts back to 'SZUKAJ…', which means that the whole section is altered (probably replaced with a copy), resulting in loss of every previously attached event handlers – which breaks the search, or any 3rd party element that uses scripts for interaction:

This is a very bad practice, and it should not be used if possible – as it results in loss of attached script handlers. Unfortunately there is absolutely no way for the search to prevent this. I would suggest a solution if there was any, but it is not caused by the search itself, but by a script that alters the node structure of the header section.
You might have to ask the menu developer if this is something that can be turned off, or if there is any way for the menu to simply hide the elements, but not to make copies and change the header structure.

Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)