1
I have a business card app, when the user registers a card has a tag field that are the key words of the card.
It can also edit that card, so it can edit the tags.
When he clicks edit, I put all the data of the card already in the fields and there it is like this:
And that’s where the problem lives, I don’t know why the keyword field looks like this, it doesn’t look like the other.
This is where I create this field:
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">find_in_page</i>
<div class="chips chips-placeholder palavras-chave" placeholder="Palavras Chave"></div>
</div>
</div>
This is where I insert in the field the tags he added to edit if you want:
$(".chips").append(
`<div class="chip">
${results.rows.item(i).descricao}
<i class="close material-icons">close</i>
</div>`
);
Does anyone know what it might be? Because it doesn’t fill in at the beginning of the field like the others?
Most likely because your CSS is written to reach the tag
input
and not the tagdiv
, I’ve never actually seen a div withplaceholder=" "
. But I can only tell you for sure if that’s right if you post your full CSS... But I have strong suspicions that’s what I said– hugocsl
You must be initiating the field with
.chips()
before entering the values. Why You Don’t Use The Columndata
of initializer to enter the initial data?– Woss
@hugocsl I’ll check my css.
– user128909
@Andersoncarloswoss as it can have an x number of tags, I insert inside a for, and when I tried to do with the date it does not insert all, it inserts only the last value of the repetition loop.
– user128909
@Andersoncarloswoss or else it inserts all values into one tag.
– user128909
Another point that corroborates the suspicion is that an element
div
does not receive the pseudo classfocus
, that is, the event offoco
does not work with div... If that’s right tell me that I can come up with an answer with more details– hugocsl