macOS: Add MultilineTextInput smart quote em/en dash automatic conversion toggle
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
- Enter text into a multiline text input including double quotes.
- 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.
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.
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.