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:
2026-06-10 22:42:27 +02:00
parent e189cb3b73
commit b32fd403ec
2 changed files with 44 additions and 16 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tp/tp-date-input",
"version": "2.1.1",
"version": "2.1.2",
"description": "",
"main": "tp-date-input.js",
"scripts": {