Skip to content

Hide the phone edit toolbar when the pad is read-only #308

Description

@HMarzban

Problem

On a phone, the edit toolbar above the keyboard can show while the pad is read-only.

ToolbarMobile.tsx:46 returns early on !editor || !isKeyboardOpen || !padOwnsKeyboard. It has no isEditable check. The toolbar handlers call editor.chain().focus()… and can still dispatch edits into a view that is not editable.

Pad Find (#250) raises the keyboard in read mode. A CSS rule in _caret-find.scss hides the toolbar while the find bar has focus. Any other input that raises the keyboard in read mode still shows the toolbar.

Fix

Change the early return to add !isEditable.

First, check on a real iPhone that settings.editor.isEditable is already true when the keyboard rises on the EditFAB tap and on the double-tap edit path. If it is not, this gate would hide the toolbar during normal editing.

Check

  • iPhone, read mode: open Find. No edit toolbar shows.
  • iPhone, edit mode: tap EditFAB, then double-tap text. The toolbar shows both times.

Part of #249.

Activity

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

    MobileUIbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions