akveo / akveo/nebular

NbRangepickerComponent and input binding with NbDatepickerDirective

Open
#2,222 2 comments 6 reactions 1 assignee Claimed by @katebatura View on GitHub
Dominant language
TypeScript
Stars
8.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue type

**I'm submitting a ...** (check one with "x")

* [x ] bug report
* [ ] feature request

### Issue description

When the value of the variable bound to a NbRangeDatepicker component is changed the datepicker component is displaying the new date but the input is not refreshed with the date.

**Expected behavior:**
The NbRangeDatepicker component should update the input.

**Steps to reproduce:**

- Pick a range of dates with the selector of the component.
- Update the variable bound to the nbRangePicker with a new valid value.
- The input contains the same text(date) but if you open the rangepicker you will see the new value.

**Related code:**
HTML:


...
TS:
this.period = { start: X end: Y };

** Hack: **
By now, is solved doing:
@ViewChild(NbDatepickerDirective, { static: false }) datePickerDirective: NbDatepickerDirective;

this.datePickerDirective.writeValue(NEWVALUE);

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.