Add a new property shouldCenterActivationPoint to NIViewAccessibilityElement. This property ensures multiline NIViewAccessibilityElements have unique touch points when merging multiline links into a single NIViewAccessibilityElement. When the first link contains either the first or the last word in the sentence and the second link spills between more than one line, the NIViewAccessibilityElement frames have the same top left point, which is used as the touch point. This causes an issue where NIAttributedLabel can’t determine which accessibilityElement a touchPoint originated from, meaning that one of the two links can’t register events. We solve this by using the center point of the frame, which is ensured to be unique (only for links in the same text) as multiline element frames would have unique y-coordinates. PiperOrigin-RevId: 544181302
Add a new property shouldCenterActivationPoint to NIViewAccessibilityElement. This property ensures multiline NIViewAccessibilityElements have unique touch points when merging multiline links into a single NIViewAccessibilityElement. When the first link contains either the first or the last word in the sentence and the second link spills between more than one line, the NIViewAccessibilityElement frames have the same top left point, which is used as the touch point. This causes an issue where NIAttributedLabel can’t determine which accessibilityElement a touchPoint originated from, meaning that one of the two links can’t register events. We solve this by using the center point of the frame, which is ensured to be unique (only for links in the same text) as multiline element frames would have unique y-coordinates.
shouldCenterActivationPoint
PiperOrigin-RevId: 544181302
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号