CustomMenus icon indicating copy to clipboard operation
CustomMenus copied to clipboard

VoiceOver - “boundary reached” sound

Open jbrayton opened this issue 2 years ago • 0 comments

To reproduce the issue:

  1. Run the app.
  2. Enable VoiceOver.
  3. Select the search field and type “b”.
  4. Press the down arrow.

Expected results: I expect the first suggestion to be selected and for nothing else to happen.

Actual results: In addition to the first suggestion becoming selected, VoiceOver emits a “boundary reached” sound.

The search field has an NSTextFieldDelegate that implements doCommandBy and returns true if the command is moveDown. So the generally default text field behavior that would normally happen as a result of the user pressing the down arrow key does not and should not happen. But VoiceOver still emits that “boundary reached” sound.

I have not found a way to avoid. this. I filed FB13106874 because the underlying AppKit behavior seems wrong to me. The full content of that FB is below. Suggestions or pull requests welcome.


FB13106874: NSTextField and VoiceOver - should not emit a “boundary reached” when delegate handles the arrow key

An NSTextField can have an NSTextFieldDelegate that implements doCommandBy, returning true if the command selector is NSResponder.moveDown. That suppresses the default behavior when the user presses the down arrow key. But when VoiceOver is enabled the user gets a “Boundary Reached” sound after the user presses the down arrow key if the cursor is at the end of the field.

This seems like a problem when the arrow key does other work instead of just leaving the cursor at the end of the text field. In my app I have a search field, and when the user presses the down arrow I select the first (or next) item in a suggestion menu. The “boundary reached” sound does not make sense in this context.

To reproduce:

  1. Open the attached sample app. Observe that there is a single NSTextField whose NSTextFieldDelegate responds to moveDown by doing nothing, just printing something and returning true.
  2. Run the app.
  3. Turn on VoiceOver.
  4. Click in the text field after “my string”, so that the cursor is at the end of the string.
  5. Press the down arrow key on a keyboard.

Expected behavior: I would expect nothing to happen except for the print statement in the app to be executed.

Actual behavior: Even though doCommandBy is executed and returns true, VoiceOver emits a “boundary reached” sound.

TextField.zip

jbrayton avatar Sep 02 '23 22:09 jbrayton