Skip to content

[2.x] Haptic feedback broken on iOS 26.5+ (Apple patched the web-haptics switch trick) #4694

Description

@imorland

Summary

Haptic feedback no longer works on iPhones running iOS 26.5+. This is caused by an Apple platform change, not a regression in Flarum's own code, but it leaves the haptic feedback feature (added in #4430 / #4434) silently dead on affected iOS devices while still advertising support.

Android is unaffected.

Root cause

Flarum's haptics go through framework/core/js/src/common/utils/haptic.ts, which delegates to the web-haptics package (currently 0.0.6).

  • On Android, web-haptics uses the real Web Vibration API (navigator.vibrate) — still works.
  • iOS Safari has no Vibration API, so web-haptics falls back to an undocumented WebKit trick: it injects a hidden <input type="checkbox" switch> and calls .click() on its associated <label> to fire the Taptic Engine.

Apple patched that exact trick in iOS 26.5. Programmatically calling .click() on a switch's label no longer fires haptics — they now only fire on a direct, physical user tap of the switch. There is no known programmatic workaround, so the iOS code path in web-haptics is effectively dead from iOS 26.5 onward.

Steps to reproduce

  1. On an iPhone running iOS 26.5+, open a forum with haptic feedback enabled.
  2. Perform any haptic-triggering action (e.g. like a post, submit a reply).
  3. No haptic feedback occurs. The same action on Android still vibrates.

Affected code

  • framework/core/js/src/common/utils/haptic.ts — wrapper; isHapticSupported returns true for any iPhone UA, so the feature/UI is still advertised on iOS even though it can no longer work.
  • Call sites: addLikeAction (flarum-likes), PostControls, DiscussionControls, ReplyComposer, DiscussionComposer, plus the user preference toggle in SettingsPage.tsx.

Upstream status

The web-haptics maintainer has acknowledged the break but shipped no fix. Relevant upstream issues:

Latest published version is 0.0.6 (Mar 2, 2026), which predates the patch — bumping the dependency does not help.

References:

Possible directions

  1. No code change — accept that web haptics are gone on iOS 26.5+ (Android keeps working) and wait for an upstream resolution.
  2. Stop advertising iOS support — adjust isHapticSupported so it no longer claims haptics work on iOS, and hide the haptic-feedback preference toggle on affected devices, so users aren't offered a setting that does nothing.
  3. Track upstream — adopt a future web-haptics release if/when Investigate iOS 26.5+ direct-tap switch fallback instead of programmatic .click() lochie/web-haptics#41 produces a viable technique.

Environment

  • Device: iPhone, iOS 26.5
  • web-haptics: 0.0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions