Skip to content

safeAreaInsets.bottom is reset to zero by overscroll recalculation #115

Description

@robin-liquidium

Summary

MarkdownEditorConfiguration.safeAreaInsets.bottom is applied in NativeTextViewWrapper.makeNSView, but the first overscroll recalculation resets NSScrollView.contentInsets.bottom to zero.

This makes the documented bottom safe area ineffective for controls or overlays placed above the editor.

Reproduction

var configuration = MarkdownEditorConfiguration.default
configuration.safeAreaInsets.bottom = 58

let editor = NativeTextViewWrapper(
    text: .constant("Example"),
    configuration: configuration
)

Host and lay out the editor, then inspect the native text view:

textView.enclosingScrollView?.contentInsets.bottom
// 0, expected 58

Cause observed in 0.11.0

NativeTextViewWrapper.makeNSView correctly sets all four configured content insets. It then calls textView.recalcOverscroll(for: scrollView). NativeTextView+FrameAndOverscroll.swift begins that method with:

scrollView.contentInsets.bottom = 0

The same reset occurs on later overscroll recalculations.

Expected

Overscroll recalculation should preserve the configured safeAreaInsets.bottom, or combine its own overscroll state with the configured inset rather than overwriting it.

Version

  • swift-markdown-engine 0.11.0
  • revision 9244f8bc88590520a902b83b9f6c3f45d0690eb7
  • macOS / AppKit NativeTextViewWrapper

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions