Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

Proposed changes

Addresses feedback from PR #5470 regarding incorrect event types in custom-select component handlers.

Changes:

  • Added ChangeEvent to imports from ../../shared/model
  • Changed handleSelectAll parameter type from InputEvent<HTMLInputElement> to ChangeEvent<HTMLInputElement> (called from onChange event handler on checkbox)
  • Changed handleClearAll parameter type from InputEvent<HTMLInputElement> to ClickEvent<HTMLButtonElement> (called from onClick event handler on DBButton)

Each handler now uses the appropriate event type matching how it's invoked:

  • handleSelectAll is called from an onChange event (line 1061-1064 in custom-select.lite.tsx), so ChangeEvent is correct
  • handleClearAll is called from an onClick event (line 1179 in custom-select.lite.tsx), so ClickEvent is correct

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

This is a stacked PR addressing specific review feedback from #5470. The type corrections ensure proper TypeScript type safety for event handlers by matching each parameter type to its actual usage in the component.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/copilot/sub-pr-5470

Copilot AI self-assigned this Dec 5, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

⚠️ No Changeset found

Latest commit: 823197c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

…ngeEvent

Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from PR #5470 on TypeScript refactor fix: correct event type for handleSelectAll and handleClearAll Dec 5, 2025
Copilot AI requested a review from mfranzke December 5, 2025 15:22
Copilot finished work on behalf of mfranzke December 5, 2025 15:22
@mfranzke
Copy link
Collaborator

mfranzke commented Dec 5, 2025

@copilot handleClearAll method is actually triggered by an onClick event, which isn't a ChangeEvent than, is it ?

Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

@copilot [handleClearAll method is actually triggered by an onClick event](https://github.com/db-ux-design-system/core-web/blob/main/packages/components/src/components/custom-select/custom-select....

You're absolutely correct! Fixed in commit 823197c. Changed handleClearAll from ChangeEvent<HTMLInputElement> to ClickEvent<HTMLButtonElement> since it's triggered by an onClick event on a DBButton, not an onChange event.

Copilot AI changed the title fix: correct event type for handleSelectAll and handleClearAll fix: correct event types for handleSelectAll and handleClearAll Dec 5, 2025
Copilot finished work on behalf of mfranzke December 5, 2025 15:40
@mfranzke mfranzke marked this pull request as ready for review December 5, 2025 15:53
@mfranzke mfranzke merged commit 9c09a53 into refactor-typescript-migrate-any Dec 5, 2025
2 checks passed
@mfranzke mfranzke deleted the copilot/sub-pr-5470 branch December 5, 2025 15:53
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in UX Engineering Team Backlog Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants