fix(tp-date-input): validate correctly when change event hasn't fired yet
validate() relied on this.value, which is only set by _inputChanged on the change event. Submitting via Enter while focus is still in an input field skips that event, leaving this.value undefined and causing valid dates to fail validation. Introduce _valueFromInputs() as the single parsing source: it reads the three sub-inputs directly and returns a UTC-midnight DateTime. validate() now falls back to it when this.value is not set. _inputChanged is refactored to call _valueFromInputs() as well, removing the duplicated format-mapping logic.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tp/tp-date-input",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"description": "",
|
||||
"main": "tp-date-input.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user