Stop the iOS keyboard flash when tapping an image (meowdown touch-tap prep)#655
Merged
Conversation
meowdown's iOS keyboard-flash fix (prosekit/meowdown#263) delivers the tap's cancelled touchend instead of a synthetic click, widening ImageClickPayload.event to MouseEvent | TouchEvent. Mirror that in the lightbox handler and the editor-mock props so the ^0.39.x bump typechecks; the handler only reads event.target, which both carry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
WalkthroughThis PR bumps the ChangesTouchEvent Support and Dependency Update
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
prosekit/meowdown#263 landed as 89aa7e7 and shipped in 0.40.0 (0.40.1 is the latest patch). Bumping the pinned range since ^0.39.0 does not resolve past 0.39.x for a 0.x package. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
On iOS, tapping an image in the editor briefly raises the software keyboard while the lightbox opens, then hides it again — a visible show/hide flash.
Root cause: meowdown's earlier guard (prosekit/meowdown#253, in 0.39.0) cancels
pointerdownfor touch, which suppresses the compatibility mouse events — but iOS WebKit's tap-to-focus is a native gesture default action tied to the touch event stream. The tap still focuses the surrounding contenteditable, and since PR #580'suserIsInteractingswizzle every focus presents the keyboard; the Radix lightbox dialog then steals focus and the keyboard drops — the flash. The only thing that stops WebKit's synthetic-click/focus path is cancelling the tap'stouchend.Fix
Fixed upstream in prosekit/meowdown#263, released in 0.40.0 (0.40.1 is the current patch): the image-click extension now recognizes single-finger taps on previews itself (movement tolerance, resize-handle/multi-touch exclusions), cancels the
touchend(killing both the focus and the synthetic click), and firesonImageClickdirectly with theTouchEvent.This PR:
@meowdown/core/@meowdown/reactfrom^0.39.0to^0.40.1— the caret range doesn't resolve past0.39.xon its own for a 0.x package, so this needed an explicit bump.handleImageClick's payload toevent: MouseEvent | TouchEventto match meowdown's widenedImageClickPayload(required understrictFunctionTypes); it only readsevent.target, which both event types carry (atouchend's target is the touchstart target — the<img>), so the view-transition source lookup is unchanged.Testing
Touchconstructor throws) covering a stationary tap firing once with touchend cancelled, a moved touch being ignored, and a resize-handle tap being left alone; full meowdown CI green across linux/mac/windows × chromium/firefox/webkit.@meowdown/core@0.40.1actually installed (not an override), verified in the?platform=iosbrowser harness — a synthesized touch tap on an image preview cancelstouchend, never focuses the editor, and opens the lightbox with the right image.pnpm --filter @reflect/desktop typecheckclean, fullsrc/editorsuite (23 files / 262 tests) passes,pnpm lintclean.🤖 Generated with Claude Code
Note
Low Risk
Narrow typing and dependency bump on editor image-click handling; no auth, data, or broad architectural changes.
Overview
Bumps
@meowdown/coreand@meowdown/reactto 0.40.1 (lockfile included), pulling in upstream image-tap handling that cancelstouchendon iOS so tapping an inline image opens the lightbox without briefly focusing the editor and flashing the keyboard.Reflect-side changes align with the wider
onImageClickpayload:handleImageClickinnote-editor.tsxnow typeseventasMouseEvent | TouchEvent(onlyevent.targetis used for the view-transition source lookup, so behavior is unchanged for mouse). The note-editor test mock matches that signature.Reviewed by Cursor Bugbot for commit e65a52e. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Chores