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
Summary
MarkdownEditorConfiguration.safeAreaInsets.bottomis applied inNativeTextViewWrapper.makeNSView, but the first overscroll recalculation resetsNSScrollView.contentInsets.bottomto zero.This makes the documented bottom safe area ineffective for controls or overlays placed above the editor.
Reproduction
Host and lay out the editor, then inspect the native text view:
Cause observed in 0.11.0
NativeTextViewWrapper.makeNSViewcorrectly sets all four configured content insets. It then callstextView.recalcOverscroll(for: scrollView).NativeTextView+FrameAndOverscroll.swiftbegins that method with: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
9244f8bc88590520a902b83b9f6c3f45d0690eb7NativeTextViewWrapper