From 64670d7cf825cdc1d3e66e21248897f2580d76e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=87=A2?= Date: Mon, 14 Sep 2020 14:37:03 +0800 Subject: [PATCH] fix:prevent url hash changes when edit keybinding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 二凢 --- packages/keymaps/src/browser/keybindings-widget.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/keymaps/src/browser/keybindings-widget.tsx b/packages/keymaps/src/browser/keybindings-widget.tsx index 572d17dabd40b..27b60fefb8315 100644 --- a/packages/keymaps/src/browser/keybindings-widget.tsx +++ b/packages/keymaps/src/browser/keybindings-widget.tsx @@ -382,7 +382,10 @@ export class KeybindingWidget extends ReactWidget { * @param item the keybinding item for the row. */ protected renderEdit(item: KeybindingItem): React.ReactNode { - return this.editKeybinding(item)}>; + return { + e.preventDefault(); + this.editKeybinding(item); + }}>; } /** @@ -392,7 +395,10 @@ export class KeybindingWidget extends ReactWidget { */ protected renderReset(item: KeybindingItem): React.ReactNode { return (item.keybinding && item.keybinding.scope === KeybindingScope.USER) - ? this.resetKeybinding(item)}> : ''; + ? { + e.preventDefault(); + this.resetKeybinding(item); + }}> : ''; } /**