Skip to content

fix(ui): sync quick insert highlight with input method - #5176

Open
KDOJP wants to merge 1 commit into
marktext:developfrom
KDOJP:fix/quick-insert-navigation-highlight
Open

fix(ui): sync quick insert highlight with input method#5176
KDOJP wants to merge 1 commit into
marktext:developfrom
KDOJP:fix/quick-insert-navigation-highlight

Conversation

@KDOJP

@KDOJP KDOJP commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Fixes inconsistent highlighting in the Quick Insert menu when switching between mouse and keyboard navigation.

Previously, hovering one item while navigating with the arrow keys could make the hovered item appear selected even though Enter executed a different internally active item.

Closes #5175

Changes

  • Switch the menu into keyboard-navigation styling when arrow-key navigation starts.
  • Return control to mouse highlighting on actual pointer movement and synchronize the active item with the hovered item.
  • Clear the input-mode styling when the menu closes.
  • Add an end-to-end regression test covering mouse hover, keyboard navigation, the visible highlight, and the heading inserted by Enter.

Expected behavior

  • Mouse movement highlights and activates the item under the pointer.
  • Arrow-key navigation keeps the keyboard-active item highlighted, even when the pointer remains over another item.
  • Enter executes the item that is visibly highlighted.

Testing

  • pnpm --filter @muyajs/core lint (passes with existing warnings)
  • pnpm --filter @muyajs/core lint:types
  • pnpm exec stylelint packages/muya/src/ui/paragraphQuickInsertMenu/index.css
  • pnpm --filter @muyajs/core test (1,438 tests passed)
  • pnpm --filter @muyajs/core check-circular
  • pnpm --filter muya-e2e exec playwright test tests/ui/slash-menu.spec.ts --project=chromium --workers=1 (8 tests passed)

The full CSS lint command still reports an unrelated, pre-existing no-descending-specificity error in src/assets/styles/blockSyntax.css:945; the changed stylesheet passes targeted Stylelint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quick insert highlight can differ from the keyboard selection

1 participant