Reply To: Searchbox doesn't work in header on tablet or mobile

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Searchbox doesn't work in header on tablet or mobile Reply To: Searchbox doesn't work in header on tablet or mobile

#15720
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi Emre,

The problem is that the header widget area actually makes a DOM clone of the search bar in mobile view (and likely in tablet view too, I can see 3 copies), so the same search bar is ‘copied’, creating invalid HTML (because of duplicate IDs) and loss of attached event handlers. This is a very bad practice, and it cannot be resolved with any custom code or option – as the issue is caused by the html cloning itself. I’m not sure which script is it exactly, but likely the widget controller.

The only possible resolution in this case is to use the search bar in a different position instead. A simple search form without any features would work there I guess, but anything that uses javascript will most likely fail in that position.

Do you need help with manually placing the shortcode to the header? If so, let me know, and I will try to look up the theme source.

Best,
Ernest Marcinko

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