ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

Datepicker input automatically changes the displayed value

Open daniel-seitz opened this issue 4 years ago • 3 comments

Bug description: Written input is automatically changed when the minDate /maxDate is specified and the written value is invalid In v5.4 it still worked as expected In v5.5 it broke

This is especially wrong since the formControl.value stays as written, and also the ngModelChange event emits that written date

Reproduce: Go to: https://valor-software.com/ngx-bootstrap/old/5.5.0/#/datepicker#min-max Type in an invalid date (1.1.) and leave the input (TAB-key) -> The value of the input is automatically changed to minDate

Working example: Go to: https://valor-software.com/ngx-bootstrap/old/5.4.0/#/datepicker#min-max Type in an invalid date (1.1.) and leave the input (TAB-key) -> Written value stays as it was typed in

This issue is likely related to https://github.com/valor-software/ngx-bootstrap/issues/6066

Versions see above

Expected behavior The value should not automatically change.

For us its a critical issue, think of long questionnaires with personal health information dealing with automatic payments in a big business environment - please let me know if I can/should support on this

daniel-seitz avatar May 07 '21 13:05 daniel-seitz

I am facing the same issue with v7.0.0

markusvorraber avatar Sep 09 '21 11:09 markusvorraber

Same here, very bad! I'm on 5.6.2

~~Since the date picker got removed in V8 I don't think this will be fixed.~~ Sorry, I think the issue is the new BsDatepicker

Looks like the issue is still there in V8, automatically updating invalid dates (before the minimal/after the max) to the current min/max value is just wrong!

Et3rnal avatar Feb 02 '22 08:02 Et3rnal

Is this going to be fixed? We need to be able to show a message indicating the date they wrote is before or after the min/max date. We don't want it to be magically updated without the user is being notified. At least provide an option to disable the automatic update.

WillemDeNys avatar Sep 08 '22 10:09 WillemDeNys

This issue should be top priority, currently this date picker is unusable.

gslusarek-cic avatar Sep 30 '22 14:09 gslusarek-cic

same issue "ngx-bootstrap": "9.0.0",

aliabbaszade1990 avatar Jan 13 '23 11:01 aliabbaszade1990