Skip to content

fix(datapicker): input update issue with reactive forms - #2945

Merged
yggg merged 4 commits into
akveo:masterfrom
vladsklov:fix/2030-datapicker_with_filled_reactive_form
Nov 24, 2021
Merged

fix(datapicker): input update issue with reactive forms#2945
yggg merged 4 commits into
akveo:masterfrom
vladsklov:fix/2030-datapicker_with_filled_reactive_form

Conversation

@vladsklov

@vladsklov vladsklov commented Nov 12, 2021

Copy link
Copy Markdown

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

Fixes #2030
Move $init emission of picker component (NbBasePickerComponent) from AfterViewInit to OnInit to prevent ExpressionChangedAfterItHasBeenCheckedError error. Emission at OnInit stage is fine init$ subscribers needs it to know when it's safe to read inputs of picker and at OnInit inputs are already set.

Fixes #2898
Removes this.onChange(this.queue) in picker.init$ subscription as it marks FormControl as dirty. It's invalid behavior as we're at the init stage, and the user didn't touch a control.

@vladsklov vladsklov self-assigned this Nov 12, 2021
@vladsklov vladsklov changed the title fix(datapicker): input updat issue with reactive forms fix(datapicker): input update issue with reactive forms Nov 12, 2021
@vladsklov
vladsklov force-pushed the fix/2030-datapicker_with_filled_reactive_form branch from b4abf75 to e7e772b Compare November 16, 2021 12:06
@vladsklov
vladsklov force-pushed the fix/2030-datapicker_with_filled_reactive_form branch from e7e772b to 5cf112d Compare November 17, 2021 13:27
@vladsklov vladsklov linked an issue Nov 17, 2021 that may be closed by this pull request
@yggg yggg added this to the 9.0.0 milestone Nov 22, 2021
@yggg
yggg merged commit 07527f8 into akveo:master Nov 24, 2021
@rhessus

rhessus commented Jan 25, 2022

Copy link
Copy Markdown

this pull request has some impact on the NbDateTimePickerComponent (view issue #3002)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datepicker triggers valueChanges when component inits ExpressionChangedAfterItHasBeenCheckedError: nb-datepicker with filled reactive form

3 participants