A view's focus and blur events are not supposed to bubble up to the view's parents according to our documentation here...
On Android, they do bubble up. This can cause confusion since these events will bubble up to the window which use the focus and blur events to indicate if the window is active, not if it has gained/received input focus.
This is not an issue on iOS.
Steps to reproduce:
- Build and run the below code on Android.
- If the TextField has the focus, then tap on the "Remove Focus" button.
- Clear the Android log.
- Tap on the "Set Focus" button.
- In the log, notice that the TextField focus event's "bubbles" property is set true. This is wrong.
- In the log, notice the Window received a focus event after the TextField did. This is wrong.
- Tap on the "Remove Focus" button.
- In the log, notice that the TextField blur event's "bubbles" property is set true. This is wrong.
- In the log, notice the Window received a blur event after the TextField did. This is wrong.
The focus and blur events should not not bubble. Their bubbles property should be false and the parent window should not have received the TextField's events.
Set the focus and blur event's cancelBubble property to true to prevent the event from propagating up the view hierarchy.