Skip to content

AppKit and UIKit editors slow down when typing extremely long blocks of text #25

Description

@kyle-n

Describe the bug
If I type extremely long blocks of text, the UIKit and AppKit editors slow down. If I type >52,000 characters in either editor, the editor takes a noticeable amount of time to catch up with whatever I'm typing.

To Reproduce
See gist with sample project.

  • Set @State var for HighlightedTextEditor to a string of >50,000 characters
  • Attempt to type in the editor

Expected behavior

  • The editor accepts and displays text from new keypresses at the same fast speed, no matter how many characters I have typed previously.

Screenshots

Screen.Recording.2021-01-11.at.9.37.59.AM.mov

Environment
Please include:

  • macOS 11.2 Beta (20D5029f) and iOS 14.2 (simulator)

Additional context

  • Happening on current main branch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AppKitIssues related to the macOS AppKit editorUIKitIssues related to the iOS UIKit editorbugSomething isn't workinghelp wantedExtra attention is needed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions