fix(editor): use native drag events on anchorElem for full-width drop targeting#104
Conversation
… targeting The drag handle sits in the anchorElem's left padding, outside the Lexical contentEditable. Lexical's DRAGOVER_COMMAND / DROP_COMMAND only fire on the contentEditable, so dragging straight down (or left) from the handle never triggered the drop indicator. Switch from Lexical drag commands to native dragover/drop listeners on the anchorElem so the full container width — including the handle area — is a valid drag target. Also skip the horizontal bounds check during drag so the cursor can stay over the handle column. Closes #99 Co-authored-by: Ona <no-reply@ona.com>
The PR Shepherd was closing ona-user PRs as duplicates when their linked issue was already closed by a prior (insufficient) fix. User-initiated PRs may intentionally re-address a previously-closed issue. Add exemptions for ona-user labeled PRs in both the closed-issue and multi-PR duplicate checks. Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review: Approved ✅ The root cause analysis is correct — Lexical's Switching to native Clean removal of unused Lexical imports. No scope creep. CI and E2E pass. |
|
✅ UI verification passed — design spec compliance confirmed. Static analysis of
Visual verification (Playwright screenshots on
Changes are purely behavioral (native DOM events instead of Lexical commands) with no visual output differences. |
|
✅ Post-merge verification passed. E2E suite: 27/27 tests passed against Ad-hoc smoke tests:
|
Problem
Follow-up to #100 — the vertical dead zone fix didn't address the real issue. The drag handle sits in the
anchorElem's 32px left padding, outside the LexicalcontentEditable. Lexical'sDRAGOVER_COMMAND/DROP_COMMANDonly fire when the cursor is over thecontentEditable, so dragging straight down or slightly left from the handle never triggers the drop indicator. The user has to move the cursor right into the text area for the drop to register.Root cause
Lexical dispatches
DRAGOVER_COMMAND/DROP_COMMANDfrom its own event listeners on thecontentEditableelement. The drag handle and the padding area to its left are outside that element, so native drag events in that zone are never forwarded to Lexical's command system.Fix
DRAGOVER_COMMAND/DROP_COMMANDhandlers with nativedragover/droplisteners on theanchorElem— this covers the full container width including the handle areauseUnboundedSearch) so the cursor can stay in the handle columnCOMMAND_PRIORITY_HIGH,DRAGOVER_COMMAND,DROP_COMMAND,mergeRegister)Also fixes the PR Shepherd automation to skip
ona-userPRs in duplicate detection (the shepherd wrongly closed the previous attempt at this PR).Closes #99