Warning: [DOM] Found 2 elements with non-unique id
-
I got 4 warnings in my console regarding non unique IDs. It seems to come from the search field which is shown to times in the source code. I guess one for mobile and one for desktop search.
Attachments:
You must be
logged in to view attached files.
Hi,
Could you please send us a link to your website where we can see this issue?
Kind Regards
Sure. These messages only seem to appear in chrome. Safari doesn’t show these messages.
Yes, you have two search forms on your website: one in the header and another in the mobile navigation. To remove these messages, you need to disable one of them on your website.
OK but if I deactivate the search on mobile, then my customers can’t search on mobile. Is that right or do I understand anything wrong?
Yes, it is right. But you can ignore these messages on your website. They are harmless for your visitors.
Wouldn’t it be possible to change the ID for mobile search?
Both searches use the same template file because they are identical. There is no sense in duplicating this code in the theme.