@@ -38,6 +38,24 @@ func InputCursor(t *styles.Styles, cur *tea.Cursor) *tea.Cursor {
3838 return cur
3939}
4040
41+// adjustOnboardingInputCursor removes the dialog view frame offset from an
42+// input cursor. Onboarding dialogs render without Dialog.View frame, while
43+// InputCursor includes that frame offset for regular dialogs.
44+func adjustOnboardingInputCursor(t *styles.Styles, cur *tea.Cursor) *tea.Cursor {
45+ if cur == nil {
46+ return nil
47+ }
48+
49+ dialogStyle := t.Dialog.View
50+ cur.X -= dialogStyle.GetBorderLeftSize() +
51+ dialogStyle.GetPaddingLeft() +
52+ dialogStyle.GetMarginLeft()
53+ cur.Y -= dialogStyle.GetBorderTopSize() +
54+ dialogStyle.GetPaddingTop() +
55+ dialogStyle.GetMarginTop()
56+ return cur
57+}
58+
4159// RenderContext is a dialog rendering context that can be used to render
4260// common dialog layouts.
4361type RenderContext struct {