OS X 10.10 GM (14A379a) - NSTextFields on a NSScrollView lose content when scrolled beneath the translucent window title bar
| Originator: | kastansn | ||
| Number: | rdar://18506593 | Date Originated: | 2014/09/30 |
| Status: | Open | Resolved: | |
| Product: | OS X | Product Version: | 10.10 GM |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: (The following constellation may sound special, but is in fact not when you take into consideration that this is a common situation in document based apps and even in Safari, for example) When scrolled out of sight while still having the keyboard focus, a NSTextField on a NSScrollView discards its content when it is scrolled back into sight again. This is true for NSTextFields that have a NSFormatter attached and are part of a layer-backed view hierarchy. To re-enact the bug, please see the attached demo project: it contains a NSTextField on a NSScrollView that per its formatter allows only numeric values. But when there is typed in an invalid (non-numeric) value and the NSTextField is scrolled out of sight, it silently loses its content. I very much suspect this has to do with the translucent window title bars that OS X Yosemite introduced: When the NSScrollView doesn't touch the title bar and therefore is not able to be scrolled "beneath it", the bug does not occur. Also, when the view hierarchy isn't layer backed, the bug does not occur. Unfortunately, especially the latter is a critical requirement for apps that need to employ the "responsive scrolling" feature introduced with OS X Mavericks. I'd rank this as a rather critical bug because there is, in a silent and unobtrusive way, content lost that was typed in by the user. This shouldn't be allowed to happen in a modern OS. Steps to Reproduce: Please see the attached demo project. It contains a window with a NSSplitView. The right hand view of the split view is configured to be layer backed in IB. In the right hand view, there is a NSScrollView that displays a NSTextField. The text field has attached a NSNumberFormatter. Please build and run the project and type something non-numeric into the field. Scroll it out of sight and back into sight again. The text field is empty now. Type in a numeric value and repeat the process: The text field properly retains its numeric content. Expected Results: The text field shouldn't be empty after having been scrolled out of sight just because its content is non-numeric. Actual Results: The text field has lost its content. Version: Xcode 6.1 GM (but any version is affected) OS X 10.10 GM build 14A379a Notes: As far as I can tell, this bug was introduced with OS X 10.10 DP 8 already. Also, when setting a delegate for the NSTextField, control:didFailToFormatString:errorDescription: is not called when the bug occurs and the text field looses its content.
Comments
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!