UIBarButtonItem actions can be activated even when they are disabled.

Originator:samfrancis.dev
Number:rdar://50169783 Date Originated:4/24/2019
Status:open Resolved:
Product:UIKit Product Version:12.2
Classification:Bug Reproducible:yes
 
Summary:
When a UIBarButtonItem's isEnabled property is false, tapping it does nothing. But if a user has their text size set to a large accessibility size there is some additional functionality. If the user taps and holds on the button, a HUD appears showing the button's title in large text in the center of the screen. After doing this, if the user releases their finger, the button's action method will be called.

This is a big issue for apps that have workflows with input validation that rely on their UIBarButtonItems to be disabled.

Steps to Reproduce:
1. Navigate to the Settings app, under General > Accessibility > Larger Text
2. Switch "Larger Accessibility Sizes" on, and adjust the text size preference to the largest setting.
3. Launch an app that has a UIBarButtonItem with its "isEnabled" property set to false.
4. Press and hold the button until the assistive interface HUD appears, displaying the button's title.
5. Release the press.

Expected Results:
The HUD disappears and nothing else happens.

Actual Results:
The HUD disappears and the button's action is called.

Version/Build:
iOS 12.2

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!