toga icon indicating copy to clipboard operation
toga copied to clipboard

macOS: Add MultilineTextInput smart quote em/en dash automatic conversion toggle

Open kattni opened this issue 6 months ago • 2 comments

Describe the bug

There is a default setting on macOS that enables smart quotes (Keyboard>Input Sources>Use smart quote and dashes). When enabled, entering text into a MultilineTextInput box results in straight quotes being converted to smart quotes. This is an issue when saving code or a config file, as it breaks the formatting.

Steps to reproduce

  1. Enter text into a multiline text input including double quotes.
  2. Straight quotes are converted to smart quotes.

Expected behavior

Straight quotes should remain as such.

Screenshots

No response

Environment

  • Operating System: macOS 15.4.1
  • Python version: 3.13
  • Software versions:
    • Toga: 0.5.1

Logs


Additional context

This behavior can be disabled using textView.automaticQuoteSubstitutionEnabled = False on the native widget. It has been suggested that this should be done for macOS as an immediate fix.

kattni avatar Jun 10 '25 04:06 kattni

This behavior is currently disabled on macOS.

This issue remains open to discuss the possibility of adding access to this as a feature to allow the user to enable or disable it.

kattni avatar Jun 11 '25 22:06 kattni

Hmm... maybe an enable, disable, or follow native feature? I've seen some macOS users get mad where they're using Chrome for the first time and text fields online doesn't have quote substitution; on the other hand in my opinion it'd feel sort of weird if a multiline text input on Linux suddenly started autocorrecting, so I'd like to see a 'follow native' option on here as well.

johnzhou721 avatar Sep 14 '25 18:09 johnzhou721