Skip to content

fix(input, select, textarea): emit one click event when slotted content is clicked - #31423

Merged
thetaPC merged 15 commits into
mainfrom
FW-7677
Sep 11, 2026
Merged

fix(input, select, textarea): emit one click event when slotted content is clicked#31423
thetaPC merged 15 commits into
mainfrom
FW-7677

Conversation

@thetaPC

@thetaPC thetaPC commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Issue number: resolves internal


What is the current behavior?

Clicking content in the start or end slot behaves differently in each form control. ion-input and ion-textarea emit the click event twice, while ion-select emits once but does not respond to the click at all.

The duplicate comes from the browser rather than from Ionic emitting twice. The wrapping <label> forwards the click to the native control, and that forwarded click is re-emitted from the host. Browsers skip this forwarding when the click lands on interactive content, which is why slotted buttons were never affected.

ion-select separately cancels the default action on every slotted click. A slotted link does not navigate and a slotted checkbox does not toggle, while the same markup works in ion-input.

What is the new behavior?

  • Clicking slotted content emits a single click event from all three components.
  • Decorative slotted content now activates the control: ion-input and ion-textarea focus, ion-select opens.
  • Interactive slotted content, such as a button or a link, keeps its own behavior and does not activate the control.
  • Slotted links and form controls work inside ion-select.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Previews:

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Sep 11, 2026 5:41pm UTC

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Sep 2, 2026
@thetaPC
thetaPC marked this pull request as ready for review September 2, 2026 23:17
@thetaPC
thetaPC requested a review from a team as a code owner September 2, 2026 23:17
@thetaPC
thetaPC requested a review from OS-jacobbell September 2, 2026 23:17

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I will leave more info on the ticket!

Comment thread core/src/components/select/test/basic/select.e2e.ts Outdated
Comment thread core/src/components/select/test/basic/select.e2e.ts Outdated
Comment thread core/src/components/select/test/basic/select.e2e.ts Outdated
Comment thread core/src/utils/forms/click-controller.ts
Comment thread core/src/utils/forms/click-controller.ts
Comment thread core/src/components/select/select.tsx Outdated
Comment thread core/src/components/select/select.tsx Outdated
Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
thetaPC and others added 2 commits September 8, 2026 15:31
… clicked

Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good! Great work! I left one optional suggestion to check for radio checked, but I'm fine with this either way!

Comment thread core/src/components/input/test/basic/input.e2e.ts Outdated
@thetaPC
thetaPC added this pull request to the merge queue Sep 11, 2026
Merged via the queue into main with commit d6acf12 Sep 11, 2026
56 checks passed
@thetaPC
thetaPC deleted the FW-7677 branch September 11, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants