Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VoiceOver reads attributed strings in multiple segments on iOS 15 #84

Open
NickEntin opened this issue Feb 25, 2022 · 3 comments
Open
Labels
bug Something isn't working as expected P2: Medium Priority Issues that affect the usability or accuracy of the framework. VoiceOver parity Mismatch between output of framework and actual VoiceOver behavior

Comments

@NickEntin
Copy link
Collaborator

VoiceOver now appears to read attributed strings in segments based on attribute ranges. You can see this behavior through the following example:

let attributedText = NSMutableAttributedString(string: "Hello world")
attributedText.addAttributes([.kern: 1], range: NSRange(location: 9, length: 1))

let label = UILabel()
label.attributedText = attributedText

VoiceOver will read this as Hello wor, l, d. This reproduces for a variety of attributes such as kerning, foreground color, and background color.

I was able to reproduce this on iOS 15.1.1, but not on iOS 13.3. As far as I know this is a new issue on iOS 15, but it's possible it applies to 14 as well.

@NickEntin NickEntin added bug Something isn't working as expected VoiceOver parity Mismatch between output of framework and actual VoiceOver behavior P2: Medium Priority Issues that affect the usability or accuracy of the framework. labels Feb 25, 2022
@NickEntin
Copy link
Collaborator Author

We have also reproduced this in iOS 15.0.

@NickEntin
Copy link
Collaborator Author

And this does not reproduce on iOS 14, so confirmed this is a behavior change in iOS 15.

@NickEntin
Copy link
Collaborator Author

Did a more thorough test on iOS 15.3.1 and found the following.

These attributes trigger this behavior:

  • .backgroundColor
  • .ligature
  • .kern
  • .tracking
  • .strikethroughStyle
  • .underlineStyle
  • .strokeColor
  • .strokeWidth
  • .attachment
  • .link
  • .underlineColor
  • .strikethroughColor
  • .obliqueness
  • .expansion
  • .writingDirection
  • .verticalGlyphForm

These attributes do not trigger the behavior:

  • .foregroundColor
  • .font
  • .paragraphStyle
  • .shadow
  • .textEffect
  • .baselineOffset

I'm not sure why some attributes do and some don't, and I had tested .foregroundColor before with a different result, so I'm not sure if that changed across minor OS versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected P2: Medium Priority Issues that affect the usability or accuracy of the framework. VoiceOver parity Mismatch between output of framework and actual VoiceOver behavior
Projects
None yet
Development

No branches or pull requests

1 participant