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.

Datepicker doesn't update value without hovering over it

See original GitHub issue

Describe the bug

When the v-model of the datepicker changes externally, it doesn’t update the displayed value untill you hover over it. By default I initialize the v-model to new Date() but in some cases I will overwrite this value by something I fetch from my API.

I worked like this:

<b-form-datepicker
              id="datepicker"
              v-model="date"
              value-as-date
              required
></b-form-datepicker>
@Component
export default class MyComponent extends Vue {
private date = new Date();
...
async mounted() {
    if ( ... ) {
      this.date = await ...
    }
  }
}

Expected behavior

The datepicker should update when it’s v-model updates.

Versions

Libraries:

  • BootstrapVue: 2.5.0
  • Bootstrap: 4.4.1
  • Vue: 2.6.11

Environment:

  • Browser: Chrome

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
tmorehousecommented, Feb 25, 2020

Actually this is fixed in PR #4824

There was a typo in the data property for the formattedValue (which is updated by the context event)

You can try it out in the dev docs playgound: https://bootstrap-vue.netlify.com/play

0reactions
tmorehousecommented, Mar 5, 2020

BootstrapVue 2.6.0 has been released

Read more comments on GitHub >

github_iconTop Results From Across the Web

b-form-datepicker doesn't update to v-model until it's hovered ...
It won't update until I hover or click on it. Using reset button and reset value might be a workaround, although it's not...
Read more >
DatePicker Date value not updating when typed and ...
We've got an issue where the WPF DatePicker control is not updating the binding for the Date property when the date is typed...
Read more >
Issues with Date Picker / Date Formats
The one thing I have noticed is when hovering over the formula in the 'update' value of the Datacard, the opposite date format...
Read more >
The DatePicker doesn't update its value with focus on its input ...
If I enter a value into the DatePicker and click on the button, the value is correctly fetched from the DatePicker. Now the...
Read more >
Events for displaying datepicker - UX Stack Exchange
Have a button next to dropdown (hide when other value chosen ?) and simply press it to open/close the datepicker. This is quite...
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