Fix a typo at line 353 of text_input_channel.cc (the else statement should come after #endif).
Let TextInputChannel::SendKey return false by default and check if the given key is actually handled by HandleKey. This fixes a problem of back button not responding when a TextField has a focus and a software keyboard is closed.
Change the return type of PlatformViewChannel::SendKey to bool to allow platform views to intercept key events without propagating to other handlers.
Note: TextInputChannel::HandleKey handles only key down events and thus some key up events (Left, Home, and etc.) are still redundantly propagated to PlatformViewChannel and KeyEventChannel.
This PR contains the following various fixes.
text_input_channel.cc
(theelse
statement should come after#endif
).TextInputChannel::SendKey
returnfalse
by default and check if the given key is actually handled byHandleKey
. This fixes a problem of back button not responding when a TextField has a focus and a software keyboard is closed.PlatformViewChannel::SendKey
tobool
to allow platform views to intercept key events without propagating to other handlers.Note:
TextInputChannel::HandleKey
handles only key down events and thus some key up events (Left
,Home
, and etc.) are still redundantly propagated toPlatformViewChannel
andKeyEventChannel
.