TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Using the Document App template, editing in middle of long text results in scroll position jumping around making cursor out of view

Forums > SwiftUI

How is this fixed?

I usually test with the text of Pride & Prejudice from https://www.gutenberg.org/files/1342/1342-h/1342-h.htm
Scroll down past Chapter 4, select a new cursor position, enter some text, wait several seconds, enter a few spaces, wait several seconds, press enter once or twice, wait several seconds. The scroll position during any of these wait periods is likely to move on its own, possibly more than once, such that the cursor position is now out of view.

My current setup as of 11/19/2022: Xcode 14.0, macOS 12.5.1, Mac mini M1 2020. This behavior happens in any of the iPad simulators I try. It also happens when deployed to my iPad of model MR7J2LL/A running iPadOS 16.1.

I've seen this behavior in multiple earlier versions of Xcode, macOS, and iPadOS.

Please help!

1      

For what it's worth, the cursor position jumping seems to occur more readily when specifying .font(.largeTitle) or a custom font.

I'm really hoping someone knows of a fix or a workaround for this (besides using a tiny font!).

1      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.