I tried to implement a focus indicator in my CustomMenu. On these devices, CustomMenu already provides a native focus indicator: a frame with rounded inner corners. The frame uses the system background color rather than the background color defined for the CustomMenu, and its color also changes automatically when switching between standard mode (white) and night mode (dark grey).
Based on what I see in the native menus, the intended behavior seems to be that the focused menu item uses a contrasting background color, creating a rounded focus-indicator effect.
To replicate this, I rely on CustomMenuItem.isFocused(). In the simulator, this works as expected. On the real device, however, it behaves incorrectly. Initially when activating focus, isFocused() is stuck on the third item and only starts reporting correctly once I scroll past it. When I scroll back up, isFocused() gets stuck on the current item. It only starts updating again after pressing Up a third time, and then it remains two items below the actual focus, similar to the initial state.