[SwiftUI macOS] TextField ignores '.textCase'

Number:rdar://FB9047229 Date Originated:2021-18-03
Status:Open Resolved:No
Product:SwiftUI (macOS) Product Version:
Classification:Incorrect/Unexpected Behavior Reproducible:Yes
Please describe the issue:
TextFields on macOS ignores `.textCase` modifiers. The given case is applied only to the placeholder, but not to the typed content.

Please list the steps you took to reproduce the issue:
1. Just add `.textCase(.uppercased)` to a TextField and run it on a macOS application

TextField("Type anything", text: $text).textCase(.uppercase)

What did you expect to happen?
The case should be applied to the typed text

What actually happened?
The typed text reflects the casing the user inputs, ignoring the modifier.



Check https://github.com/fjcaetano/not-awesome-swiftui


The issue is still reproducible on macOS 12.2 using Xcode 13.2.1, as can bee seen in TextFieldFormatterView.swift in the attached project


After reviewing your feedback, we have some additional information for you, or some additional information, or action is necessary for this issue:

Thanks for filing this feedback and apologies for the late response. We appreciate your patience and understanding as we work to address reported issues and continue to improve our platforms and tools.

We've made a number of changes in recent updates addressing a wide range of issues. Can you still reproduce this with the latest Xcode/SDK installed? If so, please include a sample project as a zip file, along with a video depicting the effect of the bug, and attach those files to this report for us. This will help our team with triaging and investigating this issue. Thanks again!

————————————————————————————— The complete list of logging instructions is available here: https://developer.apple.com/bug-reporting/profiles-and-logs/ —————————————————————————————-

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!