What can cause an input placeholder to hide?

1308 views javascript

I'm using Vuejs for a website, and I'm facing a strange problem.
For some reason, the placeholder of an input is showed only when I reload the page. If I navigate through the website using vue-router, it disappears. I have to reload so it is visible again.

Note : there is other placeholders who are perfectly working on the same page (not the same component tho).

What can cause a placeholder to not be displayed?

I can't really show the code, because I think the problem is more about the whole app than a tiny bit of code, here is the input anyway:

<form action="/http://localhost:4000/search">
        <input type="text" id="InputSearchArticle" v-model="searchArticle" placeholder="Browse..." />
       <router-link :to="{ name: 'search', params: {searchArticle } }">
           <div class="search-trigger" @click="triggerSearch"></div>

Thank you for your help

answered question

The placeholder only displays if no content is in the input. is your: searchArticle variable containing any content other than the empty string?

1 Answer


Are you triggering a focus event on the input by any chance?

If that's the case the placeholder might not be shown

posted this

Have an answer?


Please login first before posting an answer.