Repository navigation
Conversation
# Conflicts: # core/src/components.d.ts # core/src/components/fab-list/fab-list.tsx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 of 2 tasks
…hed types don't need @capacitor/haptics
thetaPC
approved these changes
Nov 25, 2026
thetaPC
left a comment
Contributor
There was a problem hiding this comment.
LGTM, minor suggestions
Two fixes for the description, and for ionic-docs #4892:
selectionisn't a Capacitor method. Ionic playsimpact({ style: 'LIGHT' })for it, soHaptics[detail.type]()breaks on a toggle tap.- Action sheet, alert and refresher also dispatch only on iOS. The toggle drag dispatches on every platform.
…n order during a scroll
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: #28719 - this was split into two PRs. This one and #31724 should cover the entire issue
What is the current behavior?
Currently, apps can't tell when an Ionic component plays a haptic. The
hapticsconfig can turn them all off, but there's no way to skip a single one, swap it for a different haptic, or play your own in its place.What is the new behavior?
Components now dispatch a bubbling, cancelable
ionHapticevent from their host element right before they play a haptic. Thedetail.typematches the Capacitor Haptics method we'd call (selectionStart,impact, etc.), exceptselection, which has no Capacitor method, so we play a lightimpactfor it. Impacts and notifications also includestyleornotificationType. CallingpreventDefault()skips the built-in haptic for that event. The event still fires whenhapticsisfalseor the Haptics plugin isn't installed, so an app can turn ours off and play its own.selectionEndis the one exception. It doesn't play anything and only releases the haptic engine, so we always run it even when the event is canceled. If we didn't, canceling onlyselectionEndwould leave the engine started, and the next gesture'sselectionChangedwould play even if that gesture'sselectionStarthad been canceled.HapticEventandHapticEventDetailare exported from core and the Angular, React and Vue packages, the same wayBackButtonEventis.Does this introduce a breaking change?
The haptic helpers now take the host element, but they aren't exported publicly, so nothing outside core calls them. This is a new feature, which is why it's pointed at
feature-9.1.Other information
ionHapticisn't a Stencil@Event, so it won't show up in the component API tables or the framework prop types. Binding@ionHapticon a component in Vue doesn't fire because Vue hyphenates the name toion-haptic, so the docs show adding a listener ondocumentinstead. That docs PR is in progress on theFW-7943branch, here: ionic-team/ionic-docs#4892The event only fires where a component would play a haptic, so action sheet and alert only dispatch it in
iosmode, refresher only with the native iOS refresher, and the picker column and a toggle tap only on iOS. Dragging a toggle dispatches it on every platform.