Skip to content

Conversation

@mfranzke
Copy link
Collaborator

@mfranzke mfranzke commented Nov 11, 2025

Proposed changes

The condition for resetting a date related input wouldn't accept the empty string as a valid value, whereas this works perfectly fine with a native input[type="date"] HTML element.

resolves #5439

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/5439-dbinput-inserting-an-empty-string-doesnt-empty-date-form-fields

@mfranzke mfranzke self-assigned this Nov 11, 2025
@mfranzke mfranzke added 🐛bug Something isn't working 👩‍👧‍👦communityFeedback Feedback from community labels Nov 11, 2025
@mfranzke mfranzke linked an issue Nov 11, 2025 that may be closed by this pull request
7 tasks
@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

🦋 Changeset detected

Latest commit: 08691bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@db-ux/ngx-core-components Patch
@db-ux/core-foundations Patch
@db-ux/core-components Patch
@db-ux/react-core-components Patch
@db-ux/v-core-components Patch
@db-ux/wc-core-components Patch
@db-ux/core-stylelint Patch
@db-ux/core-migration Patch
@db-ux/agent-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 📺showcases Changes to 1-n showcases 🏘components and removed 🅰angular labels Nov 11, 2025
@mfranzke mfranzke enabled auto-merge (squash) November 11, 2025 17:28
@mfranzke mfranzke moved this from 🏗 In progress to 🎁 Ready for review in UX Engineering Team Backlog Nov 11, 2025
@mfranzke mfranzke requested a review from Copilot November 11, 2025 17:28
@mfranzke mfranzke changed the title 5439 dbinput inserting an empty string doesnt empty date form fields fix(dbinput): inserting an empty string doesn't empty date form fields Nov 11, 2025
@mfranzke mfranzke changed the title fix(dbinput): inserting an empty string doesn't empty date form fields fix(dbinput): inserting an empty string doesn't reset date form fields Nov 11, 2025
@github-actions github-actions bot added the 📕documentation Improvements or additions to documentation label Nov 11, 2025
Copilot finished reviewing on behalf of mfranzke November 11, 2025 17:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where setting an empty string value on Angular date input fields would not clear the field, which differs from the native HTML input[type="date"] behavior. The fix modifies the writeValue method's condition to allow empty strings to pass through and clear date-related input types.

  • Modified the Angular-specific writeValue overwrite to not return early when an empty string is passed for date/time input types
  • Updated the Angular showcase to demonstrate resetting date inputs with an empty string

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/components/scripts/post-build/components.ts Fixed the condition in the Angular writeValue overwrite to allow empty strings to clear date/time/week/month/datetime-local inputs
showcases/angular-showcase/src/app/components/form/form.component.ts Updated the resetValues method to reset the date input field to an empty string instead of 'reset'

Copy link
Contributor

Copilot AI commented Nov 11, 2025

@mfranzke I've opened a new pull request, #5441, to work on those changes. Once the pull request is ready, I'll request review from you.

@github-project-automation github-project-automation bot moved this from 🎁 Ready for review to ⏰ready for release in UX Engineering Team Backlog Nov 17, 2025
Copy link
Contributor

Copilot AI commented Nov 21, 2025

@mfranzke I've opened a new pull request, #5499, to work on those changes. Once the pull request is ready, I'll request review from you.

@mfranzke mfranzke merged commit 884b03d into main Nov 26, 2025
72 checks passed
@mfranzke mfranzke deleted the 5439-dbinput-inserting-an-empty-string-doesnt-empty-date-form-fields branch November 26, 2025 17:44
@github-project-automation github-project-automation bot moved this from ⏰ready for release to ✅ Done in UX Engineering Team Backlog Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 👩‍👧‍👦communityFeedback Feedback from community 🏘components 📕documentation Improvements or additions to documentation 📺showcases Changes to 1-n showcases

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

DBInput: inserting an empty string doesn't empty date form fields

3 participants