Fix handling of the platform onKeyDown

Only call it if the event hasn't been handled yet.
pull/21833/head
Clemens Zeidler 2021-03-03 22:06:36 +13:00
parent 1cfb0e99d4
commit 0214397e27
1 changed files with 3 additions and 2 deletions

View File

@ -485,9 +485,10 @@ class LoggedInView extends React.Component<IProps, IState> {
unread: true, unread: true,
}); });
break; break;
default:
// if we do not have a handler for it, pass it to the platform which might
handled = PlatformPeg.get().onKeyDown(ev);
} }
// if we do not have a handler for it, pass it to the platform which might
handled = PlatformPeg.get().onKeyDown(ev);
if (handled) { if (handled) {
ev.stopPropagation(); ev.stopPropagation();
ev.preventDefault(); ev.preventDefault();