Skip to content

feat(date-picker): add automatic validation for required fields#3814

Open
adrianschmidt-bot wants to merge 2 commits intoLundalogik:mainfrom
adrianschmidt-bot:feat/date-picker-required-validation
Open

feat(date-picker): add automatic validation for required fields#3814
adrianschmidt-bot wants to merge 2 commits intoLundalogik:mainfrom
adrianschmidt-bot:feat/date-picker-required-validation

Conversation

@adrianschmidt-bot
Copy link
Contributor

@adrianschmidt-bot adrianschmidt-bot commented Feb 1, 2026

Summary

Adds automatic validation for required date picker fields, matching the existing behavior of limel-select.

How it works

When a date picker has the required prop set, it will now automatically show an invalid state after the user has interacted with the component and left it empty.

The validation is triggered when the calendar closes (hideCalendar), ensuring the field won't appear invalid before the user has had a chance to enter a value. This follows the same pattern used in limel-select.

Changes

  1. Added hasInteracted state - Tracks whether the user has interacted with the date picker
  2. Compute isInvalid - Combines the explicit invalid prop with automatic validation:
    • isInvalid = invalid || (hasInteracted && required && !value)
  3. Trigger validation on close - Sets hasInteracted = true when the calendar closes
  4. New example - date-picker-required.tsx demonstrates the validation behavior

User experience

  • Initial state: Field shows required asterisk but no error styling
  • User opens and closes picker without selecting: Field becomes invalid (red styling)
  • User selects a date: Field becomes valid again
  • User clears the date: Field becomes invalid again (if already interacted)

Fixes #3839

Summary by CodeRabbit

  • Bug Fixes

    • Validation and focus/blur edge cases refined so errors appear only after user interaction; calendar/input blur behavior fixed.
  • New Features

    • Input and calendar now render together for more consistent interaction and event flow.
    • Interaction tracking added so validation and focus state update reliably after user actions.
  • Documentation

    • Added an interactive example demonstrating required validation and toggles for disabled, readonly, and required.

@coderabbitai
Copy link

coderabbitai bot commented Feb 1, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Wraps date-picker render in a Host, adds private hasInteracted state and isFieldInvalid() helper to delay required validation until after user interaction, updates native/calendar blur and change handlers to mark interaction, syncs MDC/Flatpickr validation, and adds a required-example component.

Changes

Cohort / File(s) Summary
DatePicker Core
src/components/date-picker/date-picker.tsx
Wrap render in Host; add hasInteracted state and isFieldInvalid() helper; replace direct this.invalid checks with isFieldInvalid(); add handleNativeBlur, handleCalendarBlur, and other interaction handlers; guard hideCalendar with showPortal; propagate interaction state across input, calendar, portal, clear, and value changes; update MDCTextField/Flatpickr validity handling.
Example: Required
src/components/date-picker/examples/date-picker-required.tsx
New DatePickerRequiredExample component demonstrating required validation that activates after first user interaction; manages value, disabled, readonly, required with toggles and event handlers.
Examples / Registration
src/components/date-picker/...
Add/modify example registration/exports to include the new required-example (example metadata/files updated).

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant DP as DatePicker
    participant FP as Flatpickr
    participant MDC as MDCTextField

    Note over User,DP: User interacts with the picker
    User->>DP: focus / open / input / click clear / blur
    DP->>DP: set hasInteracted = true
    alt non-native calendar path
        DP->>FP: open calendar / request selection
        FP-->>DP: selection / change
        DP->>DP: update value, set hasInteracted
    end
    DP->>MDC: compute & apply isFieldInvalid()
    DP-->>User: render input (clear icon shown only if value present && !required)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(date-picker): add automatic validation for required fields' is concise, specific, and accurately reflects the main change of adding interaction-based validation for required date picker fields.
Linked Issues check ✅ Passed The PR implements the agreed objective from #3646: adding automatic validation for required date pickers after user interaction, rather than hiding the clear button or preventing clearing.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing interaction-based validation for required date picker fields; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adrianschmidt adrianschmidt force-pushed the feat/date-picker-required-validation branch from 0960f55 to ae53964 Compare February 1, 2026 22:27
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/components/date-picker/date-picker.tsx (3)

197-206: ⚠️ Potential issue | 🟠 Major

Required fields should not be clearable per Issue #3646.

The PR objective states this fixes Issue #3646, which requires that "date pickers with required attribute should not be clearable." However, the current implementation still shows the clear icon (line 202) and allows clearing via clearValue() when required is true.

To align with the linked issue, the clear icon should be hidden and clearing should be prevented when required && value:

🔧 Proposed fix
         const inputProps: any = {
             onAction: this.clearValue,
         };

-        if (this.value && !this.readonly) {
+        if (this.value && !this.readonly && !this.required) {
             inputProps.trailingIcon = 'clear_symbol';
         }

230-263: 🛠️ Refactor suggestion | 🟠 Major

Wrap multiple JSX elements in <Host> instead of an array literal.

The render method returns an array [...] containing multiple JSX elements. As per coding guidelines, when returning multiple JSX elements from the render method, use the special <Host> element instead.

♻️ Proposed refactor
-        return [
+        return (
+            <Host>
             <limel-input-field
                 disabled={this.disabled}
                 readonly={this.readonly}
                 invalid={isInvalid}
                 ...
             />,
             <limel-portal
                 ...
             >
                 ...
-            </limel-portal>,
-        ];
+            </limel-portal>
+            </Host>
+        );

Note: You'll need to add Host to the import from @stencil/core.

As per coding guidelines: "When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element."


208-222: ⚠️ Potential issue | 🟠 Major

Native picker path does not track interactions for required validation.

The native input path (iOS/Android) uses nativeChangeHandler which does not set hasInteracted = true, so required validation will never trigger when the user dismisses the native date picker without selecting a value. The custom picker path tracks interaction via the onBlur handler on the input field, but the native input lacks this handler.

Set hasInteracted = true in nativeChangeHandler to ensure consistent validation behavior across platforms, or add an onBlur handler to the native input field.

🤖 Fix all issues with AI agents
In `@src/components/date-picker/date-picker.tsx`:
- Around line 205-206: Add a single helper method isInvalid() on the component
that returns a boolean and centralizes the validation: if (this.readonly) return
false; otherwise return this.invalid || (this.hasInteracted && this.required &&
!this.value); then replace the inline computations in render() (where isInvalid
is currently computed) and in fixFlatpickrFocusBug() with calls to
this.isInvalid() so both places use the same logic.

@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3814/

@adrianschmidt-bot adrianschmidt-bot force-pushed the feat/date-picker-required-validation branch from ae53964 to 0d60a9f Compare February 1, 2026 22:40
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/date-picker/date-picker.tsx (1)

229-262: 🛠️ Refactor suggestion | 🟠 Major

Wrap multiple JSX elements in <Host> instead of an array literal.

The render() method returns an array literal with multiple top-level JSX elements. As per coding guidelines, StencilJS components should wrap multiple elements in the special <Host> element instead.

♻️ Proposed fix
-        return [
+        return (
+            <Host>
             <limel-input-field
                 disabled={this.disabled}
                 readonly={this.readonly}
                 ...
             />,
+            />
             <limel-portal
                 ...
             >
                 ...
-            </limel-portal>,
-        ];
+            </limel-portal>
+            </Host>
+        );

Note: You'll need to import Host from @stencil/core.

🤖 Fix all issues with AI agents
In `@src/components/date-picker/date-picker.tsx`:
- Around line 397-400: The isFieldInvalid() method currently returns
this.invalid || (this.hasInteracted && this.required && !this.value); update it
to respect readonly fields so readonly controls are never marked invalid: either
return false immediately if this.readonly, or include a !this.readonly check in
the composite condition (e.g. this.hasInteracted && this.required && !this.value
&& !this.readonly); modify the isFieldInvalid() function accordingly to use the
this.readonly property (matching the pattern used in chip-set.tsx).

@adrianschmidt

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@adrianschmidt

This comment was marked as resolved.

@adrianschmidt

This comment was marked as resolved.

@adrianschmidt-bot adrianschmidt-bot force-pushed the feat/date-picker-required-validation branch from 0d60a9f to 34a0b55 Compare February 1, 2026 22:49
@adrianschmidt-bot adrianschmidt-bot force-pushed the feat/date-picker-required-validation branch 2 times, most recently from 95eb803 to 6e679c5 Compare February 1, 2026 23:14
@adrianschmidt-bot

This comment was marked as resolved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/date-picker/date-picker.tsx`:
- Around line 202-204: The clear icon is being hidden when a field is required
due to the condition in the DatePicker component; update the logic in the
date-picker (the block that sets inputProps.trailingIcon) so it only checks for
this.value and !this.readonly and removes the !this.required check (i.e., keep
inputProps.trailingIcon = 'clear_symbol' when required) — locate the code that
references this.value, this.readonly, this.required and inputProps.trailingIcon
in the date-picker component and remove the !this.required clause to restore the
clear button for required fields.

@adrianschmidt-bot adrianschmidt-bot force-pushed the feat/date-picker-required-validation branch from 74eec21 to 7403b9d Compare February 2, 2026 07:44
@adrianschmidt adrianschmidt requested a review from Kiarokh February 2, 2026 08:38
@coderabbitai

This comment was marked as resolved.

@adrianschmidt

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@adrianschmidt adrianschmidt force-pushed the feat/date-picker-required-validation branch from a054768 to 4517a44 Compare February 6, 2026 17:59
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/date-picker/date-picker.tsx (1)

208-221: ⚠️ Potential issue | 🟡 Minor

Native path: dismissing the picker without changing a value won't trigger required validation.

The native render path has no onBlur handler, so hasInteracted is only set when the user actually changes the value (line 283 in nativeChangeHandler). If a user opens and dismisses the native date picker without selecting anything, hasInteracted stays false and the required-but-empty state is not shown.

Compare with the non-native path where hideCalendar (line 324) sets hasInteracted = true on every close, including close-without-selection.

If you want parity, add an onBlur handler to the native <limel-input-field>:

Proposed fix
                 <limel-input-field
                     disabled={this.disabled}
                     readonly={this.readonly}
                     invalid={isInvalid}
                     label={this.label}
                     helperText={this.helperText}
                     required={this.required}
                     value={this.formatValue(this.value)}
                     type={this.nativeType}
                     onChange={this.nativeChangeHandler}
+                    onBlur={this.handleNativeBlur}
                 />

And a handler:

private handleNativeBlur = () => {
    this.hasInteracted = true;
};

@adrianschmidt-bot
Copy link
Contributor Author

d7dcb9a - Added onBlur handler to native input field for parity with non-native path.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/components/date-picker/date-picker.tsx`:
- Around line 293-295: handleNativeBlur currently sets this.hasInteracted = true
while disconnectedCallback calls hideCalendar(), which also flips
this.hasInteracted; to avoid hideCalendar doing double duty either (A)
explicitly set this.hasInteracted = true inside disconnectedCallback and keep
hideCalendar strictly UI-only, or (B) extract a small cleanup method (e.g.,
cleanupOnDisconnect) that sets this.hasInteracted and performs teardown, and
remove state mutation from hideCalendar; update references to handleNativeBlur,
disconnectedCallback, hideCalendar, and hasInteracted accordingly.
- Around line 407-415: The isFieldInvalid method (used to compute validation
state) doesn't account for the disabled prop so a control that becomes disabled
after user interaction can still appear invalid; update the isFieldInvalid()
implementation to return false when this.disabled is true (in addition to the
existing readonly check) so that disabled fields are never marked invalid —
modify the method in date-picker.tsx (function isFieldInvalid) to short-circuit
when this.disabled is truthy, consistent with how readonly is handled and
mirroring the intent in chip-set.tsx if you choose to update that file too.

@adrianschmidt-bot
Copy link
Contributor Author

⚡ Addressed CodeRabbit feedback in b2ffb84:

  1. hideCalendar() is now strictly UI-only — removed hasInteracted = true from it

    • Added handleCalendarBlur() wrapper for the blur handler
    • Set hasInteracted = true explicitly in documentClickListener and handleCalendarChange
    • disconnectedCallback() now calls hideCalendar() without side effects
  2. Kept the disabled check from the previous fixup (b15c506) — it already addressed the isFieldInvalid() issue

@adrianschmidt
Copy link
Contributor

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@adrianschmidt
Copy link
Contributor

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/date-picker/date-picker.tsx (1)

407-409: ⚠️ Potential issue | 🟡 Minor

clearValue does not set hasInteracted, so clearing a programmatically-set value on a required field won't trigger validation.

If value is set by the parent (not via user interaction), hasInteracted remains false. The clear icon is shown (line 204), and clicking it calls clearValue, which emits null — but never sets hasInteracted = true. After clearing, isFieldInvalid() returns false because hasInteracted is still false, so the required field won't show as invalid even though the user explicitly interacted.

🐛 Proposed fix
     private clearValue() {
+        this.hasInteracted = true;
         this.change.emit(null);
     }

@adrianschmidt
Copy link
Contributor

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)

src/components/date-picker/date-picker.tsx (1)> 407-409: ⚠️ Potential issue | 🟡 Minor

clearValue does not set hasInteracted, so clearing a programmatically-set value on a required field won't trigger validation.
If value is set by the parent (not via user interaction), hasInteracted remains false. The clear icon is shown (line 204), and clicking it calls clearValue, which emits null — but never sets hasInteracted = true. After clearing, isFieldInvalid() returns false because hasInteracted is still false, so the required field won't show as invalid even though the user explicitly interacted.

🐛 Proposed fix

     private clearValue() {
+        this.hasInteracted = true;
         this.change.emit(null);
     }

@adrianschmidt-bot Please have a look at this feedback from CodeRabbit.

@adrianschmidt-bot
Copy link
Contributor Author

Good catch! ⚡ Fixed in 9e10bbeclearValue now sets hasInteracted = true before emitting, so clearing a programmatically-set value will properly trigger validation on required fields.

@adrianschmidt adrianschmidt force-pushed the feat/date-picker-required-validation branch from 9e10bbe to c88e24f Compare February 7, 2026 12:53
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/date-picker/date-picker.tsx (1)

335-348: ⚠️ Potential issue | 🟡 Minor

Pre-existing: removeEventListener for the capture-phase blur listener is missing { capture: true }.

Not introduced in this PR, but worth noting: the addEventListener on line 316 registers with { capture: true }, yet removeEventListener on line 340 omits it. Per the DOM spec, a capture listener can only be removed by also specifying capture: true. This means preventBlurFromCalendarContainer is never actually removed, causing a leak on each open/close cycle.

Proposed fix
         document.removeEventListener(
             'blur',
-            this.preventBlurFromCalendarContainer
+            this.preventBlurFromCalendarContainer,
+            { capture: true }
         );

@adrianschmidt-bot
Copy link
Contributor Author

Good catch on the missing { capture: true } in the removeEventListener call! You're right that this causes the listener to never be removed, since capture listeners can only be removed when specifying the same capture option.

Since this is pre-existing code unrelated to this PR's changes, I'll open a separate issue to track this fix and keep this PR focused on the validation feature.

@adrianschmidt-bot
Copy link
Contributor Author

Opened #3833 to track the listener leak fix.

@adrianschmidt
Copy link
Contributor

@adrianschmidt-bot in this branch, please run git fetch upstream && git rebase upstream/main, resolve all conflicts, and when the rebase is finished, force-push the branch.

@adrianschmidt-bot adrianschmidt-bot force-pushed the feat/date-picker-required-validation branch from c88e24f to 7d1ac40 Compare February 7, 2026 22:38
@adrianschmidt-bot
Copy link
Contributor Author

Done! Rebased onto upstream/main and force-pushed. There were two conflicts in date-picker.tsx:

  1. The new helperText variable (handling disabled/readonly states) needed to be merged with the isInvalid variable from this PR
  2. The <Host> wrapper refactor needed to use the new helperText variable instead of this.helperText

Both resolved and the branch is now up to date. ✅

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/date-picker/date-picker.tsx (2)

367-377: 🧹 Nitpick | 🔵 Trivial

Potential double hideCalendar() call on outside click (pre-existing).

When a user clicks outside both the input and calendar:

  1. mousedown fires → documentClickListenerhasInteracted = true, hideCalendar()
  2. Input blur fires → handleCalendarBlurhasInteracted = true (no-op), hideCalendar() again

The second hideCalendar() call is mostly idempotent, but fixFlatpickrFocusBug() will construct a second new MDCTextField(...) instance for the same DOM node. This is pre-existing (previously onBlur was bound to hideCalendar directly), but worth noting since the new handler amplifies the path. A simple guard (e.g., early-return if !this.showPortal) inside hideCalendar would prevent the redundant work.

♻️ Optional: guard against redundant calls
 private hideCalendar() {
+    if (!this.showPortal) {
+        return;
+    }
+
     setTimeout(() => {
         this.showPortal = false;
     });

342-355: ⚠️ Potential issue | 🟠 Major

Remove the { capture: true } flag from addEventListener or add it to the corresponding removeEventListener to prevent listener leakage.

The addEventListener at line 322 registers the blur listener with { capture: true }, but the removeEventListener at line 347 omits the capture flag. Per the DOM spec, these are distinct listeners—a capture-phase listener and a non-capture-phase listener. The removeEventListener call is a no-op and leaves the blur listener registered, causing a memory leak. Either remove the capture flag from the addEventListener call or add { capture: true } to the removeEventListener call to ensure the listener is properly removed.

@adrianschmidt-bot
Copy link
Contributor Author

Thanks for the catch! ⚡

Fixed both issues in d6baced:

  1. Capture flag mismatch — Added { capture: true } to the removeEventListener call so the blur listener is properly removed and doesn't leak.

  2. Double hideCalendar() calls — Added an early-return guard when !this.showPortal to prevent redundant MDCTextField instantiation.

@adrianschmidt adrianschmidt force-pushed the feat/date-picker-required-validation branch from d6baced to 405e091 Compare February 9, 2026 10:24
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/date-picker/date-picker.tsx`:
- Around line 296-303: handleCalendarBlur currently sets hasInteracted = true
and calls hideCalendar(), which couples interaction tracking with UI dismissal;
make this intent explicit by adding a brief inline comment inside
handleCalendarBlur (near the hasInteracted assignment) stating that setting
hasInteracted here is intentional for user-driven blurs and that hideCalendar()
is kept pure UI so disconnectedCallback can call hideCalendar() without marking
interaction. Keep hideCalendar() unchanged (no side-effects on hasInteracted)
and leave handleNativeBlur behavior as-is.

Comment on lines 296 to 303
private handleNativeBlur() {
this.hasInteracted = true;
}

private handleCalendarBlur() {
this.hasInteracted = true;
this.hideCalendar();
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

handleCalendarBlur couples interaction tracking with UI dismissal — consider separating concerns.

handleCalendarBlur sets hasInteracted = true and then calls hideCalendar(). Since hideCalendar() is now a pure UI method (no side-effects on hasInteracted), this coupling is acceptable. However, note that disconnectedCallbackhideCalendar() does not set hasInteracted, which is the correct behavior (no validation on teardown). This asymmetry is intentional but worth a brief inline comment for future maintainers.

🤖 Prompt for AI Agents
In `@src/components/date-picker/date-picker.tsx` around lines 296 - 303,
handleCalendarBlur currently sets hasInteracted = true and calls hideCalendar(),
which couples interaction tracking with UI dismissal; make this intent explicit
by adding a brief inline comment inside handleCalendarBlur (near the
hasInteracted assignment) stating that setting hasInteracted here is intentional
for user-driven blurs and that hideCalendar() is kept pure UI so
disconnectedCallback can call hideCalendar() without marking interaction. Keep
hideCalendar() unchanged (no side-effects on hasInteracted) and leave
handleNativeBlur behavior as-is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

6cbadcd — added inline comment explaining the intentional separation of concerns.

@adrianschmidt
Copy link
Contributor

@adrianschmidt-bot You can squash the fixups now and rebase on the latest upstream/main. Then please update the commit message to reference #3839 instead of #3646.

@adrianschmidt-bot adrianschmidt-bot force-pushed the feat/date-picker-required-validation branch from 6cbadcd to 7e2e266 Compare February 9, 2026 12:59
@adrianschmidt-bot
Copy link
Contributor Author

Done! Squashed fixups, rebased on latest upstream/main, and updated the commit reference to #3839. ⚡

New commits:

When a date picker has the `required` prop set, it will now
automatically show an invalid state after the user has interacted
with the component and left it empty.

The validation is triggered when the calendar closes (hideCalendar),
ensuring the field won't appear invalid before the user has had a
chance to enter a value.

This matches the validation behavior of limel-select.

fix: Lundalogik#3839
Wrap multiple JSX elements in the special <Host> element instead of
an array literal, per StencilJS coding guidelines.
@adrianschmidt adrianschmidt force-pushed the feat/date-picker-required-validation branch from 7e2e266 to 8d88861 Compare February 9, 2026 21:21
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.

limel-date-picker: Add internal validation for required fields

2 participants