Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Do not update date field actual value if invalid #1334

Merged
merged 3 commits into from
Apr 3, 2017

Conversation

floo51
Copy link
Contributor

@floo51 floo51 commented Apr 3, 2017

Should fix #1305

@@ -24,9 +24,12 @@ export default function maDateField() {
scope.rawValue = scope.value == null ? null : valueToRawValue(scope.value);

scope.$watch('rawValue', function(newRawValue) {
// ui bootstrap datepicker set value to undefined
// when the value is invalid and null if empty
const invalid = newRawValue === undefined;
Copy link
Contributor

@Kmaschta Kmaschta Apr 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you return if invalid before the field.parse?

Florian FERBACH added 2 commits April 3, 2017 16:46
@floo51 floo51 changed the title [WIP] Do not update date field actual value if invalid [RFR] Do not update date field actual value if invalid Apr 3, 2017
@floo51 floo51 requested a review from jpetitcolas April 3, 2017 14:58
@jpetitcolas jpetitcolas merged commit 9a8957f into master Apr 3, 2017
@jpetitcolas jpetitcolas deleted the fix_datepicker_values_disappearing branch April 3, 2017 15:00
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.

Date field cannot be typed in
3 participants