question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Value not displaying in Safari inside v-for

See original GitHub issue

This is specific to safari. I’m passing in the data through a loop as in the code below in a table. It works in other browsers, but not safari. I’m on the latest Vue version, just wondering if you might know why it’s doing this.

<tr v-for="(transfer, index ) in shared.transfers" :key="transfer.id">
                                <td>
                                    <datepicker format="dd MMM yyyy" wrapper-class="d-block" input-class="form-control" :name="'transfer_start_date_'+transfer.id" :id="'transfer_start_date_'+transfer.id" :value="transfer.start_date"></datepicker>
                                </td>
                                <td>
                                    <datepicker format="dd MMM yyyy" wrapper-class="d-block" input-class="form-control" :name="'transfer_end_date_'+transfer.id" :id="'transfer_end_date_'+transfer.id" v-model="transfer.end_date"></datepicker>
                                </td>
                                <td>
                                    <input class="form-control" v-model="transfer.companion" type="text">
                                </td>
                                <td>
                                    <input class="form-control" v-model="transfer.area" type="text">
                                </td>
                                <td>
                                    <button class="btn btn-sm btn-danger" @click="removeTransfer(index)"><i class="fa fa-trash-o"></i></button>
                                </td>
                            </tr>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
larsemilcommented, Jul 20, 2018

I have the same issue. Makes v-model kind of hard to work with.

0reactions
tiagomatoswebcommented, Jul 10, 2019

This issue seems to persist in Safari. I noticed that creating new Date(‘YYYY-MM-DD HH:MM:SS’) format throws error, while in Chrome does not.

So, I did the said hack, used moment() to reformat the date, like

new Date(moment(myDate).format())

It because moment will convert the date into ISO 8601 format which is YYYY-MM-DDTHH:MM:SS (T in the middle), then Safari can recognise.

You could also split the original string and manually reformat the date adding T in the middle, then use new Date().

Agree stupid but…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text fields in Safari browser not working - Apple Community
The only way I have found to get it working, is to repeatedly refresh, click the URL bar, type something in the URL...
Read more >
select element(optgroup) value is not displaying in safari - CSS
This is an issue when you use optgroup for both firefox and safari unfortunately, there are very less options we can try for...
Read more >
focus-visible - CSS: Cascading Style Sheets - MDN Web Docs
It may not be obvious as to why the focus indicator is appearing and disappearing if a person is using mixed forms of...
Read more >
Form with controller action, not working on Safari only (!)
Got a problem with a module. It functions in Firefox and Chrome, but not in Safari. It seems that the action fired from...
Read more >
Input not display in text box when viewed in Firefox or Safari?
Hi,I paid for having a bronze account.But when i get a problem last week and posted my problem on this form, no one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found