Skip to content

[Bug] keyboard navigation issue with lists #4644

Description

@Arnache

Description

A series of manipulation breaks navigation with keyboard

Steps to Reproduce

Open MarkText

Type : * [space] A [return] B [up arrow] [return] [backspace] [up arrow] [return] [return] [return]

Expected Behavior

Subsequent uses of up arrow should allow you to go up one line.

Actual Behavior

Up arrow is not able to bring you up, you have to click on the line instead.

Screenshots / Logs

No response

Operating System

Linux (Other)

MarkText Version

v0.17.1

OS Version

Ubuntu 24.04 4 LTS

Reproducibility

  • I can reliably reproduce this issue

Activity

  1. added
    🐛 bug
    on Jun 23, 2026
  2. FurkaanBoraa commented on Jun 25, 2026

    @FurkaanBoraa
    Contributor

    Thanks for the fix in #4660 — that resolves the keystroke path that left a childless list item.

    A quick follow-up: a childless list item can also come straight from Markdown, which #4660 doesn't cover. A bullet list with an empty middle item — setContent('* A\n* \n* B') — still parses to a list-item with zero children, and the original symptom remains: with the caret in "B", ArrowUp doesn't move it up to "A" (and ArrowDown from "A" can't reach "B").

    The cause is the one your commit message already names — previousContentInContext / nextContentInContext return null when the adjacent sibling is an empty container with no content descendant.

    I have a small fix that makes those two helpers skip empty sibling containers, with ArrowUp/ArrowDown regression tests. Happy to open a PR if that's useful — or feel free to fold it into your own work.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions