Skip to content

fix(date-picker): prevent value changes when disabled or readonly#3822

Open
adrianschmidt-bot wants to merge 1 commit intoLundalogik:mainfrom
adrianschmidt-bot:fix/3815-disabled-date-picker
Open

fix(date-picker): prevent value changes when disabled or readonly#3822
adrianschmidt-bot wants to merge 1 commit intoLundalogik:mainfrom
adrianschmidt-bot:fix/3815-disabled-date-picker

Conversation

@adrianschmidt-bot
Copy link
Contributor

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

Fixes #3815

Prevent the date picker from responding to focus events or input changes when the component is disabled or readonly. This ensures that disabled date pickers cannot be interacted with via keyboard or mouse.

Changes

  • Guard showCalendar() to return early if disabled or readonly
  • Guard handleInputElementChange() to prevent value changes when disabled or readonly

Summary by CodeRabbit

  • Bug Fixes
    • Fixed date picker to properly respect disabled and read-only states, preventing calendar opening and input field interactions when these states are active.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Added protective guards to two event handler methods in the date-picker component to prevent calendar opening and input value changes when the component is disabled or read-only. Uses early returns and event propagation stopping to block interactions in these states.

Changes

Cohort / File(s) Summary
Date-picker interaction guards
src/components/date-picker/date-picker.tsx
Added guards in showCalendar and handleInputElementChange to prevent calendar portal opening and input value processing when component is disabled or read-only. Implements event.stopPropagation() to block event propagation in disabled/read-only states.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • Kiarokh
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(date-picker): prevent value changes when disabled or readonly' accurately describes the main change: adding guards to prevent interactions when the component is disabled or read-only.
Linked Issues check ✅ Passed The pull request successfully addresses issue #3815 by adding guards in showCalendar() and handleInputElementChange() to prevent user interactions and value changes when the date-picker is disabled or read-only.
Out of Scope Changes check ✅ Passed All changes are focused on adding guards to prevent interactions in disabled/read-only states, directly addressing the linked issue with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

Prevent the date picker from responding to focus events or input changes
when the component is disabled or readonly. This ensures that disabled
date pickers cannot be interacted with via keyboard or mouse.

Fixes Lundalogik#3815
@adrianschmidt-bot adrianschmidt-bot force-pushed the fix/3815-disabled-date-picker branch from c6547a6 to 4d8ac58 Compare February 3, 2026 16:50
@adrianschmidt-bot adrianschmidt-bot marked this pull request as ready for review February 3, 2026 16:50
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

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

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-picker: value can still be changed when component is disabled

1 participant