Skip to content

fix(components): [select/v2] stop change event bubbling#23669

Merged
btea merged 1 commit intodevfrom
fix/select-change-event-bubbling
Feb 27, 2026
Merged

fix(components): [select/v2] stop change event bubbling#23669
btea merged 1 commit intodevfrom
fix/select-change-event-bubbling

Conversation

@Dsaquel
Copy link
Member

@Dsaquel Dsaquel commented Feb 16, 2026

fix #13485

Like @click, stop event bubbling for @change event.

Summary by CodeRabbit

  • Bug Fixes

    • Native change events from Select filter inputs no longer bubble to ancestor elements, preventing unintended propagation.
  • Tests

    • Added tests to confirm filterable Selects do not emit native change events to parent elements.

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e790dd and 78751a5.

📒 Files selected for processing (4)
  • packages/components/select-v2/__tests__/select.test.ts
  • packages/components/select-v2/src/select.vue
  • packages/components/select/__tests__/select.test.ts
  • packages/components/select/src/select.vue
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/components/select-v2/src/select.vue
  • packages/components/select/tests/select.test.ts
  • packages/components/select/src/select.vue
  • packages/components/select-v2/tests/select.test.ts

📝 Walkthrough

Walkthrough

Added stop-propagation for native change events on filter inputs in both Select implementations and added tests verifying that native change events from the filter input do not bubble to parent elements.

Changes

Cohort / File(s) Summary
Select Component Implementations
packages/components/select/src/select.vue, packages/components/select-v2/src/select.vue
Added @change.stop on the filter input to prevent native change event propagation.
Select Component Tests
packages/components/select/__tests__/select.test.ts, packages/components/select-v2/__tests__/select.test.ts
Added tests that attach a native change listener to a parent element, trigger change on the filter input, assert the handler is not called, and remove the parent element during cleanup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

Contribution::Community, Needs Review

Suggested reviewers

  • rzzf
  • keeplearning66

Poem

🐰 I stopped a change from taking flight,
No more bubbling, quiet and light.
Tests hop in place, confirming the trick,
A nibble of code, now tidy and quick. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal and lacks details about the implementation approach and testing considerations. Expand the description to explain how the fix stops event bubbling and reference which component files were modified for better clarity.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: stopping change event bubbling for select/v2 components.
Linked Issues check ✅ Passed The PR successfully addresses issue #13485 by adding @change.stop modifier to filter inputs in both select and select-v2 components to prevent change event bubbling.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective: adding @change.stop modifiers to select components and corresponding test cases to verify the fix.
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 (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/select-change-event-bubbling

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 16, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus/element-plus@23669
npm i https://pkg.pr.new/element-plus/element-plus@23669
yarn add https://pkg.pr.new/element-plus/element-plus@23669.tgz

commit: 78751a5

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Size Change: +132 B (+0.01%)

Total Size: 1.66 MB

Filename Size Change
./dist/element-plus/dist/index.full.js 493 kB +41 B (+0.01%)
./dist/element-plus/dist/index.full.min.js 322 kB +24 B (+0.01%)
./dist/element-plus/dist/index.full.min.mjs 317 kB +22 B (+0.01%)
./dist/element-plus/dist/index.full.mjs 483 kB +45 B (+0.01%)
ℹ️ View Unchanged
Filename Size
./dist/element-plus/dist/index.css 47.4 kB

compressed-size-action

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.45% 17978 / 21038
🔵 Statements 84.24% 18818 / 22336
🔵 Functions 83.33% 4811 / 5773
🔵 Branches 73.98% 10361 / 14004
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/components/select-v2/src/select.vue 78.57% 78.51% 68.88% 78.18% 6-7, 154, 211-214, 217, 279, 297-296, 305-304, 317-316
packages/components/select/src/select.vue 88.39% 77.27% 81.48% 88.99% 401, 403-404, 407, 573, 7, 152, 203-205, 267, 308-310, 307-310
Generated in workflow #1537

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

🧪 Playground Preview: https://element-plus.run/?pr=23669
Please comment the example via this playground if needed.

Copy link
Member

@keeplearning66 keeplearning66 left a comment

Choose a reason for hiding this comment

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

👍

@keeplearning66 keeplearning66 added the conflict pending need to resolve conflicts label Feb 24, 2026
@github-actions
Copy link

@Dsaquel This PR has conflicts, please resolve them.

@Dsaquel Dsaquel force-pushed the fix/select-change-event-bubbling branch from d296cdd to 4e790dd Compare February 26, 2026 23:37
@github-actions github-actions bot removed the conflict pending need to resolve conflicts label Feb 26, 2026
@Dsaquel Dsaquel force-pushed the fix/select-change-event-bubbling branch from 4e790dd to d296cdd Compare February 26, 2026 23:44
@Dsaquel Dsaquel force-pushed the fix/select-change-event-bubbling branch from d296cdd to 78751a5 Compare February 26, 2026 23:47
@btea btea merged commit 1dc0345 into dev Feb 27, 2026
17 checks passed
@btea btea deleted the fix/select-change-event-bubbling branch February 27, 2026 00:04
@github-actions
Copy link

@Dsaquel Thanks for your contribution! ❤️

@element-bot element-bot mentioned this pull request Feb 28, 2026
3 tasks
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.

[Component] [select] el-select filtering: Unable to prevent bubbling behavior of change events

4 participants